From dd31f3fc0e044fdae139aefcb21773249c30eb74 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 16 Jun 2006 23:14:12 +0000 Subject: [PATCH] r16322: Klocwork #481., Don't deref null on malloc fail. Jeremy. --- source/libads/ldap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/libads/ldap.c b/source/libads/ldap.c index 7fb5dac51bb..be15643ba2f 100644 --- a/source/libads/ldap.c +++ b/source/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; -- 2.11.4.GIT