aboutsummaryrefslogtreecommitdiff
path: root/src/sftp.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2012-10-05 11:08:05 +0200
committerAndreas Schneider <asn@cryptomilk.org>2012-10-05 11:12:13 +0200
commitb5c4b090da254c1ad3689983b0cb999b09aa3394 (patch)
tree11e258c3b98b3af3be8c19f32745f11d869b74c6 /src/sftp.c
parentfd2064d0b4cdafc35a3430e7528e32a6abf2d513 (diff)
downloadlibssh-b5c4b090da254c1ad3689983b0cb999b09aa3394.tar.gz
libssh-b5c4b090da254c1ad3689983b0cb999b09aa3394.tar.xz
libssh-b5c4b090da254c1ad3689983b0cb999b09aa3394.zip
sftp: Fix a memory on error in sftp_opendir().
Diffstat (limited to 'src/sftp.c')
-rw-r--r--src/sftp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/sftp.c b/src/sftp.c
index 456f94a7..822360af 100644
--- a/src/sftp.c
+++ b/src/sftp.c
@@ -893,6 +893,7 @@ sftp_dir sftp_opendir(sftp_session sftp, const char *path){
dir = malloc(sizeof(struct sftp_dir_struct));
if (dir == NULL) {
ssh_set_error_oom(sftp->session);
+ free(file);
return NULL;
}
ZERO_STRUCTP(dir);