1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +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);
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);