summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-08-13 16:52:53 -0700
committerMichael Adam <obnox@samba.org>2008-08-14 11:22:47 +0200
commit40b133eb88600049d1aed403540d441c7f23c5b9 (patch)
tree9d98bbc6f6417ee88a0aa83dc62f01ab1906dc60
parent0595ecb3a6c1719a12f443b40650aaf642617b00 (diff)
downloadsamba-40b133eb88600049d1aed403540d441c7f23c5b9.tar.gz
samba-40b133eb88600049d1aed403540d441c7f23c5b9.tar.bz2
samba-40b133eb88600049d1aed403540d441c7f23c5b9.zip
Fix coverity CID: 594. Resource leak on error path.
Jeremy. (This used to be commit 1f38b9963c4ec0d73da496a72ba4ee74d8d581c9)
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index f80240042c..635898a9d5 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -5037,8 +5037,10 @@ static WERROR getprinter_level_7(Printer_entry *print_hnd, int snum, RPC_BUFFER
if((printer=SMB_MALLOC_P(PRINTER_INFO_7))==NULL)
return WERR_NOMEM;
- if (!construct_printer_info_7(print_hnd, printer, snum))
- return WERR_NOMEM;
+ if (!construct_printer_info_7(print_hnd, printer, snum)) {
+ result = WERR_NOMEM;
+ goto out;
+ }
/* check the required size. */
*needed += spoolss_size_printer_info_7(printer);