mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +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:
parent
9fe2cf1b20
commit
6ca5eaccfa
@ -153,7 +153,6 @@ static void ads_destroy(ADS_STRUCT **ads)
|
|||||||
#ifdef HAVE_LDAP
|
#ifdef HAVE_LDAP
|
||||||
ads_disconnect(*ads);
|
ads_disconnect(*ads);
|
||||||
#endif
|
#endif
|
||||||
SAFE_FREE((*ads)->config.schema_path);
|
|
||||||
SAFE_FREE((*ads)->config.config_path);
|
SAFE_FREE((*ads)->config.config_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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 && !ads->config.schema_path) {
|
||||||
if (ADS_ERR_OK(ads_schema_path(ads, mem_ctx, &tmp_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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user