From f014291edda9449c73757063fc306d564445cc18 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 20 Jun 2006 19:06:57 +0000 Subject: r16424: Fix possible null deref and a memory leak found by examining Klockwork #1519. get_printer_subkeys() could return zero without initializing it's return pointer arg. Fixed this. Added free of subkey pointer return in registry/reg_printing.c (interesting that neithe Coverity or Klocwork found this one). Jeremy. (This used to be commit 4fbeae1a3ac3499e5d9f566655cbafccd9d691cb) --- source3/printing/nt_printing.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/printing') diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 6a7fd4d398..5c4039722e 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -2767,6 +2767,8 @@ int get_printer_subkeys( NT_PRINTER_DATA *data, const char* key, fstring **subke fstring *subkeys_ptr = NULL; fstring subkeyname; + *subkeys = NULL; + if ( !data ) return 0; -- cgit