svn commit: samba r15569 - branches/SAMBA_3_0/source/printing trunk/source/printing

vlendec at samba.org vlendec at samba.org
Sat May 13 17:17:09 GMT 2006


Author: vlendec
Date: 2006-05-13 17:17:07 +0000 (Sat, 13 May 2006)
New Revision: 15569

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15569

Log:
Fix Coverity bug # 287. Jerry, can you check if WERR_NOMEM is a correct error
code here?

Thanks,

Volker

Modified:
   branches/SAMBA_3_0/source/printing/nt_printing.c
   trunk/source/printing/nt_printing.c


Changeset:
Modified: branches/SAMBA_3_0/source/printing/nt_printing.c
===================================================================
--- branches/SAMBA_3_0/source/printing/nt_printing.c	2006-05-13 17:13:46 UTC (rev 15568)
+++ branches/SAMBA_3_0/source/printing/nt_printing.c	2006-05-13 17:17:07 UTC (rev 15569)
@@ -3020,8 +3020,19 @@
 
 	/* build the ads mods */
 	ctx = talloc_init("nt_printer_publish_ads");
+	if (ctx == NULL) {
+		SAFE_FREE(prt_dn);
+		return WERR_NOMEM;
+	}
+
 	mods = ads_init_mods(ctx);
 
+	if (mods == NULL) {
+		SAFE_FREE(prt_dn);
+		talloc_destroy(ctx);
+		return WERR_NOMEM;
+	}
+
 	get_local_printer_publishing_data(ctx, &mods, printer->info_2->data);
 	ads_mod_str(ctx, &mods, SPOOL_REG_PRINTERNAME, 
 	            printer->info_2->sharename);

Modified: trunk/source/printing/nt_printing.c
===================================================================
--- trunk/source/printing/nt_printing.c	2006-05-13 17:13:46 UTC (rev 15568)
+++ trunk/source/printing/nt_printing.c	2006-05-13 17:17:07 UTC (rev 15569)
@@ -3020,8 +3020,19 @@
 
 	/* build the ads mods */
 	ctx = talloc_init("nt_printer_publish_ads");
+	if (ctx == NULL) {
+		SAFE_FREE(prt_dn);
+		return WERR_NOMEM;
+	}
+
 	mods = ads_init_mods(ctx);
 
+	if (mods == NULL) {
+		SAFE_FREE(prt_dn);
+		talloc_destroy(ctx);
+		return WERR_NOMEM;
+	}
+
 	get_local_printer_publishing_data(ctx, &mods, printer->info_2->data);
 	ads_mod_str(ctx, &mods, SPOOL_REG_PRINTERNAME, 
 	            printer->info_2->sharename);



More information about the samba-cvs mailing list