mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-05 04:40:31 +09:00
sftp: Fix a possible null pointer dereference
CID 1395721
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit cc83b463ce)
This commit is contained in:
@@ -163,10 +163,12 @@ error:
|
||||
if (sftp->channel != NULL) {
|
||||
ssh_channel_free(sftp->channel);
|
||||
}
|
||||
if (sftp->read_packet->payload != NULL) {
|
||||
ssh_buffer_free(sftp->read_packet->payload);
|
||||
if (sftp->read_packet != NULL) {
|
||||
if (sftp->read_packet->payload != NULL) {
|
||||
ssh_buffer_free(sftp->read_packet->payload);
|
||||
}
|
||||
SAFE_FREE(sftp->read_packet);
|
||||
}
|
||||
SAFE_FREE(sftp->read_packet);
|
||||
SAFE_FREE(sftp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user