summaryrefslogtreecommitdiff
path: root/src/SftpNegotiationCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2015-05-28 22:15:25 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2015-05-28 22:15:25 +0900
commitbb8df11d7e036d485f52330ef9989e18541dad62 (patch)
treecf7c575b6655557522c993fe3a9f2dff7e93b3bd /src/SftpNegotiationCommand.cc
parent70541498d85d1879dcd9af9210b88a0b633a4fb9 (diff)
ftp, sftp: Fix heap-after-free bug on exception
Diffstat (limited to 'src/SftpNegotiationCommand.cc')
-rw-r--r--src/SftpNegotiationCommand.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/SftpNegotiationCommand.cc b/src/SftpNegotiationCommand.cc
index 2bfdad96..c4600abb 100644
--- a/src/SftpNegotiationCommand.cc
+++ b/src/SftpNegotiationCommand.cc
@@ -299,12 +299,12 @@ void SftpNegotiationCommand::onFileSizeDetermined(int64_t totalLength)
poolConnection();
return;
}
- checkIntegrityEntry->pushNextCommand(std::unique_ptr<Command>(this));
// We have to make sure that command that has Request object must
// have segment after PieceStorage is initialized. See
// AbstractCommand::execute()
getSegmentMan()->getSegmentWithIndex(getCuid(), 0);
+ checkIntegrityEntry->pushNextCommand(std::unique_ptr<Command>(this));
prepareForNextAction(std::move(checkIntegrityEntry));
disableReadCheckSocket();