smbd: Fix a leases.tdb record leak
commitfbd97ee822337534006ffcd14e08c8068e178266
authorVolker Lendecke <vl@samba.org>
Tue, 10 Dec 2019 09:56:44 +0000 (10 10:56 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 10 Dec 2019 21:57:05 +0000 (10 21:57 +0000)
tree0ff0e73d94644d756822b357fe50c6d5204d294b
parent7535359602e8b33e38ef1e0e38dc070773a39ea8
smbd: Fix a leases.tdb record leak

If we set e->stale=true in the share_mode_forall_entries() callback,
the share entry will be removed directly. Thus further down
share_mode_forall_leases() won't find anything anymore. Only find
possibly still connected entries in the first walk, and then remove
the share_entries.tdb record straight away after the leases and
brlocks have been removed.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Dec 10 21:57:05 UTC 2019 on sn-devel-184
source3/locking/share_mode_lock.c