s3-spoolss: Don't leak memory.
authorAndreas Schneider <asn@samba.org>
Wed, 20 Feb 2013 08:06:51 +0000 (09:06 +0100)
committerAlexander Bokovoy <ab@samba.org>
Fri, 22 Feb 2013 15:36:13 +0000 (16:36 +0100)
Reviewed-by: Alexander Bokovoy <ab@samba.org>
source3/rpc_server/spoolss/srv_spoolss_nt.c

index ef203d8f545c0fb4452f39f5077a3f7b4d3cd325..891f4296b93e2859686089e65fb3633b63774832 100644 (file)
@@ -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;