summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-13 04:05:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:23 -0500
commit19879eba8378f58db403c27202b9cc0af60db559 (patch)
treeefbd3f280c8c8e991b798dab2cba79d8c5eacce7
parentacc651a31be5f099aa5a13ba854b0a130be5d30d (diff)
downloadsamba-19879eba8378f58db403c27202b9cc0af60db559.tar.gz
samba-19879eba8378f58db403c27202b9cc0af60db559.tar.bz2
samba-19879eba8378f58db403c27202b9cc0af60db559.zip
r14289: Fix coverity #101, resource leak on error code path.
Jeremy. (This used to be commit d9e1d6fed099e7651807aa839a743fc7756ee326)
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 573603b659..dd706b68ed 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -7046,12 +7046,17 @@ WERROR _spoolss_enumforms(pipes_struct *p, SPOOL_Q_ENUMFORMS *q_u, SPOOL_R_ENUMF
DEBUGADD(5,("Number of user forms [%d]\n", *numofforms));
*numofforms += numbuiltinforms;
- if (*numofforms == 0)
+ if (*numofforms == 0) {
+ SAFE_FREE(builtinlist);
+ SAFE_FREE(list);
return WERR_NO_MORE_ITEMS;
+ }
switch (level) {
case 1:
if ((forms_1=SMB_MALLOC_ARRAY(FORM_1, *numofforms)) == NULL) {
+ SAFE_FREE(builtinlist);
+ SAFE_FREE(list);
*numofforms=0;
return WERR_NOMEM;
}
@@ -7114,7 +7119,6 @@ WERROR _spoolss_enumforms(pipes_struct *p, SPOOL_Q_ENUMFORMS *q_u, SPOOL_R_ENUMF
SAFE_FREE(builtinlist);
return WERR_UNKNOWN_LEVEL;
}
-
}
/****************************************************************************