[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Sun Apr 4 15:23:37 MDT 2010


The branch, master has been updated
       via  488fe76... libwbclient: Fix a memleak in wbcListTrusts
       via  50a625c... libwbclient: Fix memleaks in tests
       via  b1b723d... libwbclient: Fix a memleak in wbcListTrusts
      from  6e40fa9... s3: Fix the GNU ld version detection on SLES

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


- Log -----------------------------------------------------------------
commit 488fe76a22b4550110d41068d721c30b337825b5
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Apr 4 22:49:38 2010 +0200

    libwbclient: Fix a memleak in wbcListTrusts

commit 50a625ce0edc13312030d24df4b0b7eeaa50bfb0
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Apr 4 22:49:18 2010 +0200

    libwbclient: Fix memleaks in tests

commit b1b723da6f7545f387ab64eb4ad2df2cf59e2623
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Apr 4 22:26:40 2010 +0200

    libwbclient: Fix a memleak in wbcListTrusts

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

Summary of changes:
 nsswitch/libwbclient/tests/wbclient.c |   10 ++++++++++
 nsswitch/libwbclient/wbc_util.c       |   12 +++++-------
 2 files changed, 15 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/nsswitch/libwbclient/tests/wbclient.c b/nsswitch/libwbclient/tests/wbclient.c
index 0074040..a63811a 100644
--- a/nsswitch/libwbclient/tests/wbclient.c
+++ b/nsswitch/libwbclient/tests/wbclient.c
@@ -149,6 +149,7 @@ static bool test_wbc_sidtostring(struct torture_context *tctx)
 		"wbcSidToString failed");
 	torture_assert_str_equal(tctx, sid_string, sid_string2,
 		"sid strings differ");
+	wbcFreeMemory(sid_string2);
 
 	return true;
 }
@@ -165,6 +166,7 @@ static bool test_wbc_guidtostring(struct torture_context *tctx)
 		"wbcGuidToString failed");
 	torture_assert_str_equal(tctx, guid_string, guid_string2,
 		"guid strings differ");
+	wbcFreeMemory(guid_string2);
 
 	return true;
 }
@@ -185,6 +187,7 @@ static bool test_wbc_domain_info(struct torture_context *tctx)
 		"wbcDomainInfo failed");
 	torture_assert(tctx, info,
 		"wbcDomainInfo returned NULL pointer");
+	wbcFreeMemory(info);
 
 	return true;
 }
@@ -228,7 +231,9 @@ static bool test_wbc_users(struct torture_context *tctx)
 			"wbcLookupSid returned no name");
 		torture_assert_wbc_ok(tctx, wbcLookupUserSids(&sid, true, &num_sids, &sids),
 			"wbcLookupUserSids failed");
+		wbcFreeMemory(sids);
 	}
+	wbcFreeMemory(users);
 
 	return true;
 }
@@ -295,7 +300,9 @@ static bool test_wbc_users_async(struct torture_context *tctx)
 			"wbcLookupSid returned no name");
 		torture_assert_wbc_ok(tctx, wbcLookupUserSids(&sid, true, &num_sids, &sids),
 			"wbcLookupUserSids failed");
+		wbcFreeMemory(sids);
 	}
+	wbcFreeMemory(users);
 
 	return true;
 }
@@ -372,6 +379,7 @@ static bool test_wbc_trusts(struct torture_context *tctx)
 			"wbcLookupSid returned no name");
 		*/
 	}
+	wbcFreeMemory(domains);
 
 	return true;
 }
@@ -390,6 +398,7 @@ static bool test_wbc_lookupdc(struct torture_context *tctx)
 
 	torture_assert_wbc_ok(tctx, wbcLookupDomainController(domain_name, 0, &dc_info),
 		"wbcLookupDomainController failed");
+	wbcFreeMemory(dc_info);
 
 	return true;
 }
@@ -408,6 +417,7 @@ static bool test_wbc_lookupdcex(struct torture_context *tctx)
 
 	torture_assert_wbc_ok(tctx, wbcLookupDomainControllerEx(domain_name, NULL, NULL, 0, &dc_info),
 		"wbcLookupDomainControllerEx failed");
+	wbcFreeMemory(dc_info);
 
 	return true;
 }
diff --git a/nsswitch/libwbclient/wbc_util.c b/nsswitch/libwbclient/wbc_util.c
index 2a1285e..5637b2e 100644
--- a/nsswitch/libwbclient/wbc_util.c
+++ b/nsswitch/libwbclient/wbc_util.c
@@ -24,6 +24,7 @@
 
 #include "replace.h"
 #include "libwbclient.h"
+#include "../winbind_client.h"
 
 /** @brief Ping winbindd to see if the daemon is running
  *
@@ -466,16 +467,13 @@ wbcErr wbcListTrusts(struct wbcDomainInfo **domains, size_t *num_domains)
 	}
 
 	*domains = d_list;
+	d_list = NULL;
 	*num_domains = i;
 
  done:
-	if (!WBC_ERROR_IS_OK(wbc_status)) {
-		if (d_list)
-			talloc_free(d_list);
-		if (extra_data)
-			free(extra_data);
-	}
-
+	winbindd_free_response(&response);
+	talloc_free(d_list);
+	free(extra_data);
 	return wbc_status;
 }
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list