r14273: Fix coverity bug #202. Memory leak on error path.
authorJeremy Allison <jra@samba.org>
Mon, 13 Mar 2006 00:37:57 +0000 (00:37 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:15:22 +0000 (11:15 -0500)
Jeremy.
(This used to be commit d2be8163f2cf69681150ed7de720a37ffaa8e937)

source3/printing/nt_printing.c

index 5f751bf110cd1ff2e0136fc5f14ae81b7898b7b1..91530fc82cbc2ee41cd71912678d278b6d8f3081 100644 (file)
@@ -2804,8 +2804,10 @@ int get_printer_subkeys( NT_PRINTER_DATA *data, const char* key, fstring **subke
        
        /* return error if the key was not found */
        
-       if ( i == data->num_keys )
+       if ( i == data->num_keys ) {
+               SAFE_FREE(subkeys_ptr);
                return -1;
+       }
        
 done:
        /* tag off the end */