sftp: Fix a possible null pointer dereference
CID 1395721 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
parent
39975fdd6d
commit
cc83b463ce
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user