1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s3:libads: Allocate ads->config.schema_path under ADS_STRUCT talloc context

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Samuel Cabrero 2022-06-15 12:26:06 +02:00 committed by Jeremy Allison
parent 9fe2cf1b20
commit 6ca5eaccfa
2 changed files with 4 additions and 2 deletions

View File

@ -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);
}
}

View File

@ -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");
}
}
}