summaryrefslogtreecommitdiffstats
path: root/libssh/sftp.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-04-22 15:22:22 +0000
committerAndreas Schneider <mail@cynapses.org>2009-04-22 15:22:22 +0000
commit0f075f4d95d7e6a2fc7018c20a14b245ed66ace0 (patch)
treec0048531c2d6c5d26ba2cc7d8e99748107c0a580 /libssh/sftp.c
parent57a5c50a54e7c3f8c08c712810cf98e43f54f4d6 (diff)
downloadlibssh-0f075f4d95d7e6a2fc7018c20a14b245ed66ace0.tar.gz
libssh-0f075f4d95d7e6a2fc7018c20a14b245ed66ace0.tar.xz
libssh-0f075f4d95d7e6a2fc7018c20a14b245ed66ace0.zip
Improve sftp_packet_free().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@578 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/sftp.c')
-rw-r--r--libssh/sftp.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libssh/sftp.c b/libssh/sftp.c
index 1ee7636..b4a7f81 100644
--- a/libssh/sftp.c
+++ b/libssh/sftp.c
@@ -395,10 +395,13 @@ static int sftp_read_and_dispatch(SFTP_SESSION *sftp) {
return 0;
}
-void sftp_packet_free(SFTP_PACKET *packet){
- if(packet->payload)
- buffer_free(packet->payload);
- free(packet);
+void sftp_packet_free(SFTP_PACKET *packet) {
+ if (packet == NULL) {
+ return;
+ }
+
+ buffer_free(packet->payload);
+ free(packet);
}
/* Initialize the sftp session with the server. */