aboutsummaryrefslogtreecommitdiff
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:45:12 +0200
commitcb53c4f0e1b52de46d04ea2c271452ace354a203 (patch)
tree5c58f48ebba45d97063131d4d9654a59163d2172
parent0d029e7038d074a064e2870ec35441403301d099 (diff)
downloadlibssh-cb53c4f0e1b52de46d04ea2c271452ace354a203.tar.gz
libssh-cb53c4f0e1b52de46d04ea2c271452ace354a203.tar.xz
libssh-cb53c4f0e1b52de46d04ea2c271452ace354a203.zip
sftp: Fix a memory on error in sftp_opendir().
(cherry picked from commit b5c4b090da254c1ad3689983b0cb999b09aa3394)
-rw-r--r--src/sftp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/sftp.c b/src/sftp.c
index 32ece23d..a6a555a5 100644
--- a/src/sftp.c
+++ b/src/sftp.c
@@ -940,6 +940,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);