From: Samuel Cabrero Date: Wed, 15 Jun 2022 10:29:15 +0000 (+0200) Subject: s3:libads: Allocate ads->config.config_path under ADS_STRUCT talloc context X-Git-Tag: tevent-0.13.0~224 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ea0dd1a38cd04d85527b7147618256af6c52b2d;p=thirdparty%2Fsamba.git s3:libads: Allocate ads->config.config_path under ADS_STRUCT talloc context Signed-off-by: Samuel Cabrero Reviewed-by: Jeremy Allison --- diff --git a/source3/libads/ads_struct.c b/source3/libads/ads_struct.c index 56883e8496b..ce07f2a89dd 100644 --- a/source3/libads/ads_struct.c +++ b/source3/libads/ads_struct.c @@ -153,7 +153,6 @@ static void ads_destroy(ADS_STRUCT **ads) #ifdef HAVE_LDAP ads_disconnect(*ads); #endif - SAFE_FREE((*ads)->config.config_path); } } diff --git a/source3/libads/disp_sec.c b/source3/libads/disp_sec.c index 74311aac289..a193c5bb3e9 100644 --- a/source3/libads/disp_sec.c +++ b/source3/libads/disp_sec.c @@ -218,7 +218,10 @@ void ads_disp_sd(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, struct security_descripto if (ads && !ads->config.config_path) { if (ADS_ERR_OK(ads_config_path(ads, mem_ctx, &tmp_path))) { - ads->config.config_path = SMB_STRDUP(tmp_path); + ads->config.config_path = talloc_strdup(ads, tmp_path); + if (ads->config.config_path == NULL) { + DBG_WARNING("Out of memory\n"); + } } }