summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-03-07 00:35:24 +0000
committerJeremy Allison <jra@samba.org>2003-03-07 00:35:24 +0000
commit97d25a7374e03b4411debe0d9301326ab2df709f (patch)
tree87a61fbf088af4adc0cac51afbc06e4308b0d7ad /source3
parent442a55b6b480a9d594ee0641f46b838cdc209377 (diff)
downloadsamba-97d25a7374e03b4411debe0d9301326ab2df709f.tar.gz
samba-97d25a7374e03b4411debe0d9301326ab2df709f.tar.bz2
samba-97d25a7374e03b4411debe0d9301326ab2df709f.zip
Fix noticed by Corny.Bondad@hp.com. Ensure we free up memory on error exit.
Jeremy. (This used to be commit 05a8a61af83a6d85ddbb70749c8cd0abe9eb8180)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/ipc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index 08337c2901..67c5da01f3 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -397,6 +397,7 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int
if (tpscnt) {
if((params = (char *)malloc(tpscnt)) == NULL) {
DEBUG(0,("reply_trans: param malloc fail for %u bytes !\n", tpscnt));
+ SAFE_FREE(data);
END_PROFILE(SMBtrans);
return(ERROR_DOS(ERRDOS,ERRnomem));
}
@@ -412,6 +413,8 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int
int i;
if((setup = (uint16 *)malloc(suwcnt*sizeof(uint16))) == NULL) {
DEBUG(0,("reply_trans: setup malloc fail for %u bytes !\n", (unsigned int)(suwcnt * sizeof(uint16))));
+ SAFE_FREE(data);
+ SAFE_FREE(params);
END_PROFILE(SMBtrans);
return(ERROR_DOS(ERRDOS,ERRnomem));
}