From 05b4d0b38e53de20b7aad2bbb3c6a6788d23313f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 12 Mar 2006 19:16:45 +0000 Subject: r14250: Fix coverity bug #107. Resource leak on error path. Jeremy. (This used to be commit ca96c7be778d01594a540917acd3c5c218d6459c) --- source3/rpc_server/srv_spoolss_nt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 2424c46691..951757d4c8 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -4862,8 +4862,10 @@ static WERROR getprinter_level_5(Printer_entry *print_hnd, int snum, RPC_BUFFER if((printer=SMB_MALLOC_P(PRINTER_INFO_5))==NULL) return WERR_NOMEM; - if (!construct_printer_info_5(print_hnd, printer, snum)) + if (!construct_printer_info_5(print_hnd, printer, snum)) { + free_printer_info_5(printer); return WERR_NOMEM; + } /* check the required size. */ *needed += spoolss_size_printer_info_5(printer); -- cgit