From 7af336dcb9238b3cf4882422ccdac496a75afcf8 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 20 Feb 2013 09:06:51 +0100 Subject: [PATCH] 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(-) diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c index 1b3a16f..ae3e991 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_nt.c +++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c @@ -4857,8 +4857,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; -- 1.8.1.4