From c013df3ae52d57b1206f156a2fc529f52cf39531 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 20 Feb 2013 09:06:51 +0100 Subject: s3-spoolss: Don't leak memory. Reviewed-by: Alexander Bokovoy --- source3/rpc_server/spoolss/srv_spoolss_nt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/rpc_server') diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c index ef203d8f54..891f4296b9 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_nt.c +++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c @@ -4867,8 +4867,10 @@ static WERROR string_array_from_driver_info(TALLOC_CTX *mem_ctx, &array, &num_strings); } - if (presult) { + if (presult != NULL) { *presult = array; + } else { + talloc_free(array); } return WERR_OK; -- cgit