summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-06 19:34:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:10:58 -0500
commit4d79117c6d6507fb183298882d82bfba1f857753 (patch)
tree9b730e4ac4feccf8f69aa70eb7eb4b23219a0231
parent4c0bf8d75dcaca833da2bc8b284d4ddf1d698f64 (diff)
downloadsamba-4d79117c6d6507fb183298882d82bfba1f857753.tar.gz
samba-4d79117c6d6507fb183298882d82bfba1f857753.tar.bz2
samba-4d79117c6d6507fb183298882d82bfba1f857753.zip
r13887: Fix coverity bug CID #94. mem leak on error codepath.
Jeremy. (This used to be commit dd47e0ef1175a57ec2e9b797ac942cb79f4a5d05)
-rw-r--r--source3/nmbd/nmbd_packets.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c
index 0f84b4f771..89362392fe 100644
--- a/source3/nmbd/nmbd_packets.c
+++ b/source3/nmbd/nmbd_packets.c
@@ -1670,11 +1670,13 @@ static BOOL create_listen_fdset(fd_set **ppset, int **psock_array, int *listen_n
if((count*2) + 2 > FD_SETSIZE) {
DEBUG(0,("create_listen_fdset: Too many file descriptors needed (%d). We can \
only use %d.\n", (count*2) + 2, FD_SETSIZE));
+ SAFE_FREE(pset);
return True;
}
if((sock_array = SMB_MALLOC_ARRAY(int, (count*2) + 2)) == NULL) {
DEBUG(0,("create_listen_fdset: malloc fail for socket array.\n"));
+ SAFE_FREE(pset);
return True;
}