]> 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>
Fri, 17 Feb 2023 15:52:35 +0000 (15:52 +0000)
Note this is only used with changelog, which is nonstandard and obsolete.

servers/slapd/syncrepl.c

index ea64f68198b2ad3c49de2bd435afc11f03f0c74a..3e768cc5af05f6a1f1dbb13300de4b4ff0ae1b2f 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;