summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-06-16 23:26:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:33 -0500
commit86a13b97e418a9b06dace463b296f22600ed8b2c (patch)
tree5892d8da3d154fc172c4351b906a957cb9c60f8a /source3/libads
parentd730df0493ee8135cc2315aab3ffb1a0d3b5660a (diff)
downloadsamba-86a13b97e418a9b06dace463b296f22600ed8b2c.tar.gz
samba-86a13b97e418a9b06dace463b296f22600ed8b2c.tar.bz2
samba-86a13b97e418a9b06dace463b296f22600ed8b2c.zip
r16326: Klocwork #509. Always check return allocs.
Jeremy. (This used to be commit 7e397b534a5ca5809facf5aa84acbfb0b8c9a5b4)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/ldap_printer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/libads/ldap_printer.c b/source3/libads/ldap_printer.c
index d6ac09d22b..12bf6eec1d 100644
--- a/source3/libads/ldap_printer.c
+++ b/source3/libads/ldap_printer.c
@@ -119,6 +119,9 @@ static BOOL map_dword(TALLOC_CTX *ctx, ADS_MODLIST *mods,
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 @@ static BOOL map_bool(TALLOC_CTX *ctx, ADS_MODLIST *mods,
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 @@ static BOOL map_multi_sz(TALLOC_CTX *ctx, ADS_MODLIST *mods,
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 *));