svn commit: samba r16327 - in trunk/source/libads: .

jra at samba.org jra at samba.org
Fri Jun 16 23:26:56 GMT 2006


Author: jra
Date: 2006-06-16 23:26:54 +0000 (Fri, 16 Jun 2006)
New Revision: 16327

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

Log:
Klocwork #509. Always check return allocs.
Jeremy.

Modified:
   trunk/source/libads/ldap_printer.c


Changeset:
Modified: trunk/source/libads/ldap_printer.c
===================================================================
--- trunk/source/libads/ldap_printer.c	2006-06-16 23:26:48 UTC (rev 16326)
+++ trunk/source/libads/ldap_printer.c	2006-06-16 23:26:54 UTC (rev 16327)
@@ -119,6 +119,9 @@
 	if (value->type != REG_DWORD)
 		return False;
 	str_value = talloc_asprintf(ctx, "%d", *((uint32 *) value->data_p));
+	if (!str_value) {
+		return False;
+	}
 	status = ads_mod_str(ctx, mods, value->valuename, str_value);
 	return ADS_ERR_OK(status);
 }
@@ -136,6 +139,9 @@
 		return False;
 	str_value =  talloc_asprintf(ctx, "%s", 
 				     *(value->data_p) ? "TRUE" : "FALSE");
+	if (!str_value) {
+		return False;
+	}
 	status = ads_mod_str(ctx, mods, value->valuename, str_value);
 	return ADS_ERR_OK(status);
 }
@@ -162,6 +168,9 @@
 
 	if (num_vals) {
 		str_values = TALLOC_ARRAY(ctx, char *, num_vals + 1);
+		if (!str_values) {
+			return False;
+		}
 		memset(str_values, '\0', 
 		       (num_vals + 1) * sizeof(char *));
 



More information about the samba-cvs mailing list