From: Joseph Sutton Date: Thu, 28 Sep 2023 03:39:47 +0000 (+1300) Subject: s3:libads: Fix building with FORTIFY_SOURCE=2 X-Git-Tag: tevent-0.16.0~301 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=10726fb347a0aeb463f050303c524d79fa708c7a;p=thirdparty%2Fsamba.git s3:libads: Fix building with FORTIFY_SOURCE=2 Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- 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;