source3/winbindd/winbindd_util.c: fix stackframe leak
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 17 Jul 2012 19:31:31 +0000 (05:01 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 17 Jul 2012 19:31:31 +0000 (05:01 +0930)
winbindd_can_contact_domain() doesn't always free its stackframe.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
source3/winbindd/winbindd_util.c

index ffc9115ad362efe553a67b73df005424d10aacbf..162cdf22e1a70ad2b9ff74c0e93e7cc7060082b4 100644 (file)
@@ -1173,7 +1173,8 @@ bool winbindd_can_contact_domain(struct winbindd_domain *domain)
        /* We can contact the domain if it is our primary domain */
 
        if (domain->primary) {
-               return true;
+               ret = true;
+               goto done;
        }
 
        /* Trust the TDC cache and not the winbindd_domain flags */
@@ -1181,7 +1182,8 @@ bool winbindd_can_contact_domain(struct winbindd_domain *domain)
        if ((tdc = wcache_tdc_fetch_domain(frame, domain->name)) == NULL) {
                DEBUG(10,("winbindd_can_contact_domain: %s not found in cache\n",
                          domain->name));
-               return false;
+               ret = false;
+               goto done;
        }
 
        /* Can always contact a domain that is in out forest */