From c787e626516b358d4d48309aa199bdac0f7cb736 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 4 May 2019 15:35:20 +0100 Subject: [PATCH] fxp_fstat_recv: remove unreachable cleanup code. Coverity pointed out a call to sftp_pkt_free(pktin) straight after an unconditional return statement, which is obviously silly. Fortunately, it was benign: pktin was freed anyway by the function being called _by_ the return statement, so the unreachability of this free operation prevented a double-free rather than allowing a memory leak. So the right fix is to just remove the code, rather than arranging for it to be run. --- sftp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sftp.c b/sftp.c index 7a6d5441..4efcf7a1 100644 --- a/sftp.c +++ b/sftp.c @@ -596,8 +596,6 @@ bool fxp_fstat_recv(struct sftp_packet *pktin, struct sftp_request *req, sfree(req); if (pktin->type == SSH_FXP_ATTRS) { return fxp_got_attrs(pktin, attrs); - sftp_pkt_free(pktin); - return true; } else { fxp_got_status(pktin); sftp_pkt_free(pktin);