]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9997 syncrepl: plug potential leak in changelog search
authorHoward Chu <hyc@openldap.org>
Thu, 2 Feb 2023 15:12:55 +0000 (15:12 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 26 Apr 2023 16:44:21 +0000 (16:44 +0000)
Note this is only used with changelog, which is nonstandard and obsolete.

servers/slapd/syncrepl.c

index 5fceb63dcae67924631331ad00407df7f8e95910..3b02a3b5ef3f6e34d969225abead1fbc1a9ff74a 100644 (file)
@@ -604,8 +604,10 @@ ldap_sync_search(
                        lattrs[2] = NULL;
                        rc = ldap_search_ext_s( si->si_ld, "", LDAP_SCOPE_BASE, generic_filterstr.bv_val, lattrs, 0,
                                NULL, NULL, NULL, si->si_slimit, &res );
-                       if ( rc )
+                       if ( rc ) {
+                               ldap_msgfree( res );
                                return rc;
+                       }
                        msg = ldap_first_message( si->si_ld, res );
                        if ( msg && ldap_msgtype( msg ) == LDAP_RES_SEARCH_ENTRY ) {
                                BerElement *ber = NULL;