From 488fe76a22b4550110d41068d721c30b337825b5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 4 Apr 2010 22:49:38 +0200 Subject: libwbclient: Fix a memleak in wbcListTrusts --- nsswitch/libwbclient/wbc_util.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'nsswitch/libwbclient') diff --git a/nsswitch/libwbclient/wbc_util.c b/nsswitch/libwbclient/wbc_util.c index 2c2ae55d4c..5637b2ec44 100644 --- a/nsswitch/libwbclient/wbc_util.c +++ b/nsswitch/libwbclient/wbc_util.c @@ -467,18 +467,13 @@ wbcErr wbcListTrusts(struct wbcDomainInfo **domains, size_t *num_domains) } *domains = d_list; + d_list = NULL; *num_domains = i; done: winbindd_free_response(&response); - - if (!WBC_ERROR_IS_OK(wbc_status)) { - if (d_list) - talloc_free(d_list); - if (extra_data) - free(extra_data); - } - + talloc_free(d_list); + free(extra_data); return wbc_status; } -- cgit