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:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user