1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

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.
This commit is contained in:
Simon Tatham 2019-05-04 15:35:20 +01:00
parent 5f90427e0d
commit c787e62651

2
sftp.c
View File

@ -596,8 +596,6 @@ bool fxp_fstat_recv(struct sftp_packet *pktin, struct sftp_request *req,
sfree(req); sfree(req);
if (pktin->type == SSH_FXP_ATTRS) { if (pktin->type == SSH_FXP_ATTRS) {
return fxp_got_attrs(pktin, attrs); return fxp_got_attrs(pktin, attrs);
sftp_pkt_free(pktin);
return true;
} else { } else {
fxp_got_status(pktin); fxp_got_status(pktin);
sftp_pkt_free(pktin); sftp_pkt_free(pktin);