diff --git a/source3/libads/ads_struct.c b/source3/libads/ads_struct.c index 941f216359d..56883e8496b 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.schema_path); SAFE_FREE((*ads)->config.config_path); } } diff --git a/source3/libads/disp_sec.c b/source3/libads/disp_sec.c index 0b5f117788a..74311aac289 100644 --- a/source3/libads/disp_sec.c +++ b/source3/libads/disp_sec.c @@ -209,7 +209,10 @@ void ads_disp_sd(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, struct security_descripto if (ads && !ads->config.schema_path) { if (ADS_ERR_OK(ads_schema_path(ads, mem_ctx, &tmp_path))) { - ads->config.schema_path = SMB_STRDUP(tmp_path); + ads->config.schema_path = talloc_strdup(ads, tmp_path); + if (ads->config.schema_path == NULL) { + DBG_WARNING("Out of memory\n"); + } } }