svn commit: r1924756 - /apr/apr-util/branches/1.7.x/ldap/apr_ldap.c

[email protected]
Newsgroups gmane.comp.apache.apr.cvs
Message-ID <[email protected]>
Author: minfrin
Date: Thu Apr  3 13:52:06 2025
New Revision: 1924756

URL: http://svn.apache.org/viewvc?rev=1924756&view=rev
Log:
apr_ldap: Fix leak while walking attributes.

Modified:
    apr/apr-util/branches/1.7.x/ldap/apr_ldap.c

Modified: apr/apr-util/branches/1.7.x/ldap/apr_ldap.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/ldap/apr_ldap.c?rev=1924756&r1=1924755&r2=1924756&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/ldap/apr_ldap.c (original)
+++ apr/apr-util/branches/1.7.x/ldap/apr_ldap.c Thu Apr  3 13:52:06 2025
@@ -2312,6 +2312,10 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_
                  attr != NULL;
                  attr = ldap_next_attribute(ldap->ld, entry, ber)) {
                 e.nattrs++;
+                ldap_memfree(attr);
+            }
+            if (ber) {
+                ber_free(ber,0);
             }
 
             for (attr = ldap_first_attribute(ldap->ld, entry, &ber);
@@ -2385,6 +2389,9 @@ APU_DECLARE_LDAP(apr_status_t) apr_ldap_
 
                 e.aidx++;
             }
+            if (ber) {
+                ber_free(ber,0);
+            }
 
             res->nentries++;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.