mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
smbd: Panic if there's a leak in share_entries.tdb
Hopefully dbwrap_tdb's dbwrap_exists is cheap enough for this to not impact performance too much. I could not measure any difference in an open/close benchmark, but at some point things might pile up and we might have to make this a #ifdef DEVELOPER Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
committed by
Jeremy Allison
parent
415fb7d2df
commit
0bc3e7499b
@ -434,6 +434,11 @@ static NTSTATUS share_mode_data_store(
|
||||
d->sequence_number += 1;
|
||||
|
||||
if (d->num_share_modes == 0) {
|
||||
TDB_DATA key = dbwrap_record_get_key(rec);
|
||||
bool share_entries_exist;
|
||||
share_entries_exist = dbwrap_exists(share_entries_db, key);
|
||||
SMB_ASSERT(!share_entries_exist);
|
||||
|
||||
TALLOC_FREE(d->delete_tokens);
|
||||
d->num_delete_tokens = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user