aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Riordan <mriordan@ipswitch.com>2011-04-08 10:59:05 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-04-08 10:59:05 +0200
commit29bb718a93969ef429e86f3bb1734d2548846d46 (patch)
tree2a56d8b9a70ce62b56ea017b34d909baa7d8fc30 /src
parent1c062b22bf8107e6cddce0b198e0e50441826cfd (diff)
downloadlibssh-29bb718a93969ef429e86f3bb1734d2548846d46.tar.gz
libssh-29bb718a93969ef429e86f3bb1734d2548846d46.tar.xz
libssh-29bb718a93969ef429e86f3bb1734d2548846d46.zip
sftp: Fixed double-free in sftp_unlink().
Diffstat (limited to 'src')
-rw-r--r--src/sftp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sftp.c b/src/sftp.c
index d6bfa421..58859b7f 100644
--- a/src/sftp.c
+++ b/src/sftp.c
@@ -2109,10 +2109,12 @@ int sftp_unlink(sftp_session sftp, const char *file) {
ssh_set_error_oom(sftp->session);
ssh_buffer_free(buffer);
ssh_string_free(filename);
+ return -1;
}
if (sftp_packet_write(sftp, SSH_FXP_REMOVE, buffer) < 0) {
ssh_buffer_free(buffer);
ssh_string_free(filename);
+ return -1;
}
ssh_string_free(filename);
ssh_buffer_free(buffer);
@@ -2846,7 +2848,7 @@ sftp_statvfs_t sftp_statvfs(sftp_session sftp, const char *path) {
ssh_set_error(sftp,SSH_REQUEST_DENIED,"sftp version %d does not support sftp_statvfs",sftp->version);
return NULL;
}
-
+
buffer = ssh_buffer_new();
if (buffer == NULL) {
ssh_set_error_oom(sftp->session);