summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-06-16 23:14:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:33 -0500
commitbe6fd7643659406b6df986e1a96f7e9b87abfe20 (patch)
tree3c0639180eb0a5e12270e916beae0b488dff8da1 /source3/libads
parent61c96308fb03cbb1308d109f047647fa095d1b06 (diff)
downloadsamba-be6fd7643659406b6df986e1a96f7e9b87abfe20.tar.gz
samba-be6fd7643659406b6df986e1a96f7e9b87abfe20.tar.bz2
samba-be6fd7643659406b6df986e1a96f7e9b87abfe20.zip
r16322: Klocwork #481., Don't deref null on malloc fail.
Jeremy. (This used to be commit dd31f3fc0e044fdae139aefcb21773249c30eb74)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/ldap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 7fb5dac51b..be15643ba2 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -1956,8 +1956,10 @@ char **ads_pull_strings_range(ADS_STRUCT *ads,
return NULL;
}
- memcpy(&strings[*num_strings], new_strings,
- sizeof(*new_strings) * num_new_strings);
+ if (new_strings && num_new_strings) {
+ memcpy(&strings[*num_strings], new_strings,
+ sizeof(*new_strings) * num_new_strings);
+ }
(*num_strings) += num_new_strings;