]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/samba/samba-3.6.99-idmap_ad_memleak.patch
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next-suricata
[ipfire-2.x.git] / src / patches / samba / samba-3.6.99-idmap_ad_memleak.patch
CommitLineData
1d13e637
AF
1commit d88c59d3690e7c14edfc99411479c245de62e3aa
2Author: Andreas Schneider <asn@samba.org>
3AuthorDate: Wed Oct 5 10:32:16 2016 +0200
4Commit: Andreas Schneider <asn@samba.org>
5CommitDate: 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
14diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c
15index 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 }