summaryrefslogtreecommitdiffstats
path: root/source/smbd/ipc.c
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
commit05a8a61af83a6d85ddbb70749c8cd0abe9eb8180 (patch)
tree75be9ab14970062bfffa2421a14704c93e1954a3 /source/smbd/ipc.c
parent5e2755508f08ecf561348d4edf0a4064732c5213 (diff)
downloadsamba-05a8a61af83a6d85ddbb70749c8cd0abe9eb8180.tar.gz
samba-05a8a61af83a6d85ddbb70749c8cd0abe9eb8180.tar.xz
samba-05a8a61af83a6d85ddbb70749c8cd0abe9eb8180.zip
Fix noticed by Corny.Bondad@hp.com. Ensure we free up memory on error exit.
Jeremy.
Diffstat (limited to 'source/smbd/ipc.c')
-rw-r--r--source/smbd/ipc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/smbd/ipc.c b/source/smbd/ipc.c
index 08337c2901a..67c5da01f33 100644
--- a/source/smbd/ipc.c
+++ b/source/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));
}