summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-13 06:50:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:24 -0500
commitad838bf65e3e67a0a19cd3be4c969a01928f9636 (patch)
treeb3013d557e73bf9e17608f269c5f1af4f59bf786
parent860015db1fe89944e37163234505d26b7cfe5386 (diff)
downloadsamba-ad838bf65e3e67a0a19cd3be4c969a01928f9636.tar.gz
samba-ad838bf65e3e67a0a19cd3be4c969a01928f9636.tar.bz2
samba-ad838bf65e3e67a0a19cd3be4c969a01928f9636.zip
r14301: Fix coverity #224. In a loop we were forgetting to free
resources on error exit path. Jeremy. (This used to be commit f1a5e5aefeeb78512c41cc8fc075b240696a3eb7)
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 57509fcd87..31a278f7f3 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -6799,8 +6799,10 @@ static WERROR enumprinterdrivers_level2(fstring servername, fstring architecture
ndrivers=get_ntdrivers(&list, architecture, version);
DEBUGADD(4,("we have:[%d] drivers in environment [%s] and version [%d]\n", ndrivers, architecture, version));
- if(ndrivers == -1)
+ if(ndrivers == -1) {
+ SAFE_FREE(driver_info_2);
return WERR_NOMEM;
+ }
if(ndrivers != 0) {
if((driver_info_2=SMB_REALLOC_ARRAY(driver_info_2, DRIVER_INFO_2, *returned+ndrivers )) == NULL) {