[SCM] Samba Shared Repository - branch master updated

Ralph Böhme slow at samba.org
Wed Mar 8 14:00:02 UTC 2017


The branch, master has been updated
       via  980eae0 s3-libads: Do not leak the msg on error
      from  e015748 idmap_autorid: allocate new domain range if the callers knows the sid is valid

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 980eae07f9d85f627aab01090880e25cd21da55d
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Oct 5 10:33:26 2016 +0200

    s3-libads: Do not leak the msg on error
    
    ldap_search_ext_s manpage states:
    Note that res parameter of ldap_search_ext_s should be freed with
    ldap_msgfree() regardless of return value of these functions.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Wed Mar  8 14:59:35 CET 2017 on sn-devel-144

-----------------------------------------------------------------------

Summary of changes:
 source3/libads/ldap.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 34d250f..c70cdeb 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -1036,6 +1036,11 @@ done:
 		ber_bvfree(ext_bv);
 	}
 
+	if (rc != LDAP_SUCCESS && *res != NULL) {
+		ads_msgfree(ads, *res);
+		*res = NULL;
+	}
+
 	/* if/when we decide to utf8-encode attrs, take out this next line */
 	TALLOC_FREE(search_attrs);
 
@@ -1086,9 +1091,6 @@ static ADS_STATUS ads_do_paged_search(ADS_STRUCT *ads, const char *bind_path,
 		status = ads_do_paged_search_args(ads, bind_path, scope, expr,
 					      attrs, args, &res2, &count, &cookie);
 		if (!ADS_ERR_OK(status)) {
-			/* Ensure we free all collected results */
-			ads_msgfree(ads, *res);
-			*res = NULL;
 			break;
 		}
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list