summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-13 06:52:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:24 -0500
commitd72bb5627ccc14f2396f3e464686b6dfebee6ec5 (patch)
tree125c23f2512d62ed788770d9ecbaac438d816675
parentad838bf65e3e67a0a19cd3be4c969a01928f9636 (diff)
downloadsamba-d72bb5627ccc14f2396f3e464686b6dfebee6ec5.tar.gz
samba-d72bb5627ccc14f2396f3e464686b6dfebee6ec5.tar.bz2
samba-d72bb5627ccc14f2396f3e464686b6dfebee6ec5.zip
r14303: Fix coverity #223. In a loop we were forgetting to free
resources on error exit path. Jeremy. (This used to be commit f71aa3ab8fdfd08c1bec57b6506ead7c4af7299d)
-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 31a278f7f3..70432c34ca 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -6717,8 +6717,10 @@ static WERROR enumprinterdrivers_level1(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_1);
return WERR_NOMEM;
+ }
if(ndrivers != 0) {
if((driver_info_1=SMB_REALLOC_ARRAY(driver_info_1, DRIVER_INFO_1, *returned+ndrivers )) == NULL) {