aboutsummaryrefslogtreecommitdiff
path: root/libssh/buffer.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-04-01 21:29:04 +0000
committerAndreas Schneider <mail@cynapses.org>2009-04-01 21:29:04 +0000
commitfc73b0b33fbd787f10c370e8bc12946104ef376a (patch)
tree003ae4474e30e01e4d1800f123fed06fe099974b /libssh/buffer.c
parent7b464d4e158e90ddfdd70b88694ba2a039f271b9 (diff)
downloadlibssh-fc73b0b33fbd787f10c370e8bc12946104ef376a.tar.gz
libssh-fc73b0b33fbd787f10c370e8bc12946104ef376a.tar.xz
libssh-fc73b0b33fbd787f10c370e8bc12946104ef376a.zip
Add NULL check to buffer free.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@332 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/buffer.c')
-rw-r--r--libssh/buffer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libssh/buffer.c b/libssh/buffer.c
index 272c275..e55f0b8 100644
--- a/libssh/buffer.c
+++ b/libssh/buffer.c
@@ -53,6 +53,10 @@ struct buffer_struct *buffer_new(void) {
* \param buffer buffer to free
*/
void buffer_free(struct buffer_struct *buffer) {
+ if (buffer == NULL) {
+ return;
+ }
+
if (buffer->data) {
/* burn the data */
memset(buffer->data, 0, buffer->allocated);