From be6fd7643659406b6df986e1a96f7e9b87abfe20 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 16 Jun 2006 23:14:12 +0000 Subject: r16322: Klocwork #481., Don't deref null on malloc fail. Jeremy. (This used to be commit dd31f3fc0e044fdae139aefcb21773249c30eb74) --- source3/libads/ldap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/libads/ldap.c') 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; -- cgit