1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-27 13:21:11 +03:00

sftp: Fix a memory on error in sftp_opendir().

This commit is contained in:
Andreas Schneider
2012-10-05 11:08:05 +02:00
parent fd2064d0b4
commit b5c4b090da

View File

@@ -893,6 +893,7 @@ sftp_dir sftp_opendir(sftp_session sftp, const char *path){
dir = malloc(sizeof(struct sftp_dir_struct)); dir = malloc(sizeof(struct sftp_dir_struct));
if (dir == NULL) { if (dir == NULL) {
ssh_set_error_oom(sftp->session); ssh_set_error_oom(sftp->session);
free(file);
return NULL; return NULL;
} }
ZERO_STRUCTP(dir); ZERO_STRUCTP(dir);