Commit c8b5c691 authored by grapvar's avatar grapvar Committed by Quanah Gibson-Mount
Browse files

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

parent 7631dcea
...@@ -485,10 +485,8 @@ mdb_dn2sups( ...@@ -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( ...@@ -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",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment