From: Howard Chu Date: Thu, 2 Feb 2023 15:12:55 +0000 (+0000) Subject: ITS#9997 syncrepl: plug potential leak in changelog search X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a9e449b244b7b70697b73bb41d941768d1ccd65;p=thirdparty%2Fopenldap.git ITS#9997 syncrepl: plug potential leak in changelog search Note this is only used with changelog, which is nonstandard and obsolete. --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index ea64f68198..3e768cc5af 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -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;