On Tue, 24 Nov 2009, Alexander Lamaison wrote:

Can someone familiar with sftp.c explain why the memory allocated to 'data' by is freed when the conditional 'data[0] == SSH_FXP_STATUS' holds but not when it doesn't (line 1605 & 1609 of the latest version of sftp.c)?

I think it's a bug. Doesn't this patch fix it?

--- a/src/sftp.c
+++ b/src/sftp.c
@@ -1618,6 +1618,7 @@ static int sftp_fstat(LIBSSH2_SFTP_HANDLE *handle,
     }

     sftp_bin2attr(attrs, data + 5);
+    LIBSSH2_FREE(session, data);

     return 0;
 }


--

 / daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to