[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] sftp: fix memory leak in sftp_fstat
[Thread Prev] | [Thread Next]
- Subject: Re: [PATCH] sftp: fix memory leak in sftp_fstat
- From: Andreas Schneider <asn@xxxxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Sat, 22 Oct 2016 16:05:04 +0200
- To: libssh@xxxxxxxxxx
On Friday, 7 October 2016 15:50:19 CEST Pino Toscano wrote: > When parsing the result of a successful fstat call, make sure to free > the resulting reply message. Pushed to master and v0-7. Thanks! > Signed-off-by: Pino Toscano <ptoscano@xxxxxxxxxx> > --- > src/sftp.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/src/sftp.c b/src/sftp.c > index db4639b..72c9a13 100644 > --- a/src/sftp.c > +++ b/src/sftp.c > @@ -3189,7 +3189,10 @@ sftp_attributes sftp_fstat(sftp_file file) { > } > > if (msg->packet_type == SSH_FXP_ATTRS){ > - return sftp_parse_attr(file->sftp, msg->payload, 0); > + sftp_attributes attr = sftp_parse_attr(file->sftp, msg->payload, 0); > + sftp_message_free(msg); > + > + return attr; > } else if (msg->packet_type == SSH_FXP_STATUS) { > status = parse_status_msg(msg); > sftp_message_free(msg); -- Andreas Schneider GPG-ID: CC014E3D www.cryptomilk.org asn@xxxxxxxxxxxxxx
[PATCH] sftp: fix memory leak in sftp_fstat | Pino Toscano <ptoscano@xxxxxxxxxx> |