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

Improve sftp_packet_free().

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@578 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
Andreas Schneider
2009-04-22 15:22:22 +00:00
parent 57a5c50a54
commit 0f075f4d95

View File

@@ -395,10 +395,13 @@ static int sftp_read_and_dispatch(SFTP_SESSION *sftp) {
return 0; return 0;
} }
void sftp_packet_free(SFTP_PACKET *packet){ void sftp_packet_free(SFTP_PACKET *packet) {
if(packet->payload) if (packet == NULL) {
buffer_free(packet->payload); return;
free(packet); }
buffer_free(packet->payload);
free(packet);
} }
/* Initialize the sftp session with the server. */ /* Initialize the sftp session with the server. */