Fix coverity CID: 594. Resource leak on error path.
authorJeremy Allison <jra@samba.org>
Wed, 13 Aug 2008 23:52:53 +0000 (16:52 -0700)
committerMichael Adam <obnox@samba.org>
Thu, 14 Aug 2008 09:22:47 +0000 (11:22 +0200)
Jeremy.
(This used to be commit 1f38b9963c4ec0d73da496a72ba4ee74d8d581c9)

source3/rpc_server/srv_spoolss_nt.c

index f80240042c67721195cc372001a59b0276c7cb96..635898a9d5769e12b8b07987767f561b00d4a5dd 100644 (file)
@@ -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);