ITS#9214 slapd-mdb: plug cursor leak in dnSuperiorMatch filter

This commit is contained in:
grapvar 2020-04-14 21:47:00 +00:00 committed by Howard Chu
parent f747d61922
commit a5e17673a6

View File

@ -485,10 +485,8 @@ mdb_dn2sups(
data.mv_data = d; data.mv_data = d;
rc = mdb_cursor_get( cursor, &key, &data, MDB_GET_BOTH ); rc = mdb_cursor_get( cursor, &key, &data, MDB_GET_BOTH );
op->o_tmpfree( d, op->o_tmpmemctx ); op->o_tmpfree( d, op->o_tmpmemctx );
if ( rc ) { if ( rc )
mdb_cursor_close( cursor );
break; break;
}
ptr = (char *) data.mv_data + data.mv_size - 2*sizeof(ID); ptr = (char *) data.mv_data + data.mv_size - 2*sizeof(ID);
memcpy( &nid, ptr, sizeof(ID)); memcpy( &nid, ptr, sizeof(ID));
@ -507,7 +505,7 @@ mdb_dn2sups(
break; break;
} }
} }
mdb_cursor_close( cursor );
done: done:
if( rc != 0 ) { if( rc != 0 ) {
Debug( LDAP_DEBUG_TRACE, "<= mdb_dn2sups: get failed: %s (%d)\n", Debug( LDAP_DEBUG_TRACE, "<= mdb_dn2sups: get failed: %s (%d)\n",