libwbclient: Fix a memleak in wbcListTrusts
authorVolker Lendecke <vl@samba.org>
Sun, 4 Apr 2010 20:49:38 +0000 (22:49 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 4 Apr 2010 21:22:52 +0000 (23:22 +0200)
nsswitch/libwbclient/wbc_util.c

index 2c2ae55d4c04aa9b84b7901ba569b5dae2f49488..5637b2ec445cfc60c37413a4705f608676ebb550 100644 (file)
@@ -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;
 }