From: Howard Chu Date: Sat, 11 Dec 2010 04:35:01 +0000 (+0000) Subject: ITS#6744 - plug leak X-Git-Tag: MIGRATION_CVS2GIT~367 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a2053729f05efb85adb032e85a9491c32e754b3e;p=openldap ITS#6744 - plug leak --- diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index da8118746e..6d772ce2fc 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -807,6 +807,7 @@ nextresp2: } } else { + LDAPRequest *lrf = lr; if ( lr->lr_outrefcnt <= 0 && lr->lr_parent == NULL ) { /* request without any referrals */ simple_request = ( hadref ? 0 : 1 ); @@ -829,6 +830,12 @@ nextresp2: break; /* not completely done yet */ } } + /* ITS#6744: Original lr was refcounted when we retrieved it, + * must release it now that we're working with the parent + */ + if ( lrf != &dummy_lr ) { + ldap_return_request( ld, lrf, 0 ); + } /* Check if all requests are finished, lr is now parent */ tmplr = lr;