Skip to content

Commit 2423b4a

Browse files
committed
apr_ldap: Fix leak while walking attributes.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr-util/branches/1.7.x@1924756 13f79535-47bb-0310-9956-ffa450edef68
1 parent 22a3fd8 commit 2423b4a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

ldap/apr_ldap.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,6 +2312,10 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_result(apr_pool_t *pool,
23122312
attr != NULL;
23132313
attr = ldap_next_attribute(ldap->ld, entry, ber)) {
23142314
e.nattrs++;
2315+
ldap_memfree(attr);
2316+
}
2317+
if (ber) {
2318+
ber_free(ber,0);
23152319
}
23162320

23172321
for (attr = ldap_first_attribute(ldap->ld, entry, &ber);
@@ -2385,6 +2389,9 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_result(apr_pool_t *pool,
23852389

23862390
e.aidx++;
23872391
}
2392+
if (ber) {
2393+
ber_free(ber,0);
2394+
}
23882395

23892396
res->nentries++;
23902397

0 commit comments

Comments
 (0)