]>
Commit | Line | Data |
---|---|---|
1d13e637 AF |
1 | commit d88c59d3690e7c14edfc99411479c245de62e3aa |
2 | Author: Andreas Schneider <asn@samba.org> | |
3 | AuthorDate: Wed Oct 5 10:32:16 2016 +0200 | |
4 | Commit: Andreas Schneider <asn@samba.org> | |
5 | CommitDate: Wed Oct 5 10:32:16 2016 +0200 | |
6 | ||
7 | s3-winbind: Fix memory leak in ad_idmap_cached_connection_internal() | |
8 | ||
9 | Signed-off-by: Andreas Schneider <asn@samba.org> | |
10 | --- | |
11 | source3/winbindd/idmap_ad.c | 4 +++- | |
12 | 1 file changed, 3 insertions(+), 1 deletion(-) | |
13 | ||
14 | diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c | |
15 | index 2b35a4f..2b21051 100644 | |
16 | --- a/source3/winbindd/idmap_ad.c | |
17 | +++ b/source3/winbindd/idmap_ad.c | |
18 | @@ -127,7 +127,9 @@ static ADS_STATUS ad_idmap_cached_connection_internal(struct idmap_domain *dom) | |
19 | realm = wb_dom->alt_name; | |
20 | } | |
21 | ||
22 | - if ( (ads = ads_init(realm, dom->name, ldap_server)) == NULL ) { | |
23 | + ads = ads_init(realm, dom->name, ldap_server); | |
24 | + SAFE_FREE(ldap_server); | |
25 | + if (ads == NULL) { | |
26 | DEBUG(1,("ads_init failed\n")); | |
27 | return ADS_ERROR_NT(NT_STATUS_NO_MEMORY); | |
28 | } |