From: Samuel Cabrero Date: Tue, 24 May 2022 16:05:38 +0000 (+0200) Subject: s3:libads: Allocate temporary memory context for ads_domain_func_level() X-Git-Tag: tevent-0.13.0~285 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=916303356017daab5b4b8fb2346baede3249e910;p=thirdparty%2Fsamba.git s3:libads: Allocate temporary memory context for ads_domain_func_level() Prepare to allocate ADS_STRUCT under talloc context. Signed-off-by: Samuel Cabrero Reviewed-by: Jeremy Allison --- diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index c9aa42faedf..23a2dacfb4c 100755 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -3354,6 +3354,7 @@ done: ADS_STATUS ads_domain_func_level(ADS_STRUCT *ads, uint32_t *val) { + TALLOC_CTX *tmp_ctx = talloc_stackframe(); const char *attrs[] = {"domainFunctionality", NULL}; ADS_STATUS status; LDAPMessage *res; @@ -3424,6 +3425,7 @@ done: if ( ads_s != ads ) { ads_destroy( &ads_s ); } + TALLOC_FREE(tmp_ctx); return status; }