From 10726fb347a0aeb463f050303c524d79fa708c7a Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Thu, 28 Sep 2023 16:39:47 +1300 Subject: [PATCH] s3:libads: Fix building with FORTIFY_SOURCE=2 Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- source3/libads/ldap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index a639cd23dc4..740bc6bb434 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -3156,7 +3156,7 @@ int ads_count_replies(ADS_STRUCT *ads, void *res) bool *more_strings) { char *attr; - char *expected_range_attrib, *range_attr; + char *expected_range_attrib, *range_attr = NULL; BerElement *ptr = NULL; char **strings; char **new_strings; @@ -3187,7 +3187,7 @@ int ads_count_replies(ADS_STRUCT *ads, void *res) } ldap_memfree(attr); } - if (!attr) { + if (!range_attr) { ber_free(ptr, 0); /* nothing here - this field is just empty */ *more_strings = False; -- 2.34.1