svn commit: samba r16424 - in branches/SAMBA_3_0/source: printing
registry
jra at samba.org
jra at samba.org
Tue Jun 20 19:06:58 GMT 2006
Author: jra
Date: 2006-06-20 19:06:57 +0000 (Tue, 20 Jun 2006)
New Revision: 16424
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16424
Log:
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.
Modified:
branches/SAMBA_3_0/source/printing/nt_printing.c
branches/SAMBA_3_0/source/registry/reg_printing.c
Changeset:
Modified: branches/SAMBA_3_0/source/printing/nt_printing.c
===================================================================
--- branches/SAMBA_3_0/source/printing/nt_printing.c 2006-06-20 19:06:50 UTC (rev 16423)
+++ branches/SAMBA_3_0/source/printing/nt_printing.c 2006-06-20 19:06:57 UTC (rev 16424)
@@ -2767,6 +2767,8 @@
fstring *subkeys_ptr = NULL;
fstring subkeyname;
+ *subkeys = NULL;
+
if ( !data )
return 0;
Modified: branches/SAMBA_3_0/source/registry/reg_printing.c
===================================================================
--- branches/SAMBA_3_0/source/registry/reg_printing.c 2006-06-20 19:06:50 UTC (rev 16423)
+++ branches/SAMBA_3_0/source/registry/reg_printing.c 2006-06-20 19:06:57 UTC (rev 16424)
@@ -346,8 +346,10 @@
if ( lookup_printerkey(printer->info_2->data, subkeyname) == -1 ) {
DEBUG(5,("key_printers_store_keys: adding key %s\n",
existing_subkeys[i]));
- if ( add_new_printer_key( printer->info_2->data, subkeyname ) == -1 )
+ if ( add_new_printer_key( printer->info_2->data, subkeyname ) == -1 ) {
+ SAFE_FREE( existing_subkeys );
return False;
+ }
}
}
@@ -360,6 +362,8 @@
if ( printer )
free_a_printer( &printer, 2 );
+ SAFE_FREE( existing_subkeys );
+
return True;
}
More information about the samba-cvs
mailing list