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

sftp: Fixed double-free in sftp_unlink().

This commit is contained in:
Mark Riordan
2011-04-08 10:59:05 +02:00
committed by Andreas Schneider
parent 1c062b22bf
commit 29bb718a93

View File

@@ -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);