Skip to content

Commit 760271b

Browse files
committed
apr_ldap: Fix leak while walking attributes.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1924755 13f79535-47bb-0310-9956-ffa450edef68
1 parent 40db9d0 commit 760271b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: ldap/apr_ldap.c

+7
Original file line numberDiff line numberDiff line change
@@ -2332,6 +2332,10 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_result(apr_pool_t *pool,
23322332
attr != NULL;
23332333
attr = ldap_next_attribute(ldap->ld, entry, ber)) {
23342334
e.nattrs++;
2335+
ldap_memfree(attr);
2336+
}
2337+
if (ber) {
2338+
ber_free(ber,0);
23352339
}
23362340

23372341
for (attr = ldap_first_attribute(ldap->ld, entry, &ber);
@@ -2405,6 +2409,9 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_result(apr_pool_t *pool,
24052409

24062410
e.aidx++;
24072411
}
2412+
if (ber) {
2413+
ber_free(ber,0);
2414+
}
24082415

24092416
res->nentries++;
24102417

0 commit comments

Comments
 (0)