]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:locking: let share_mode_forall_entries() call TALLOC_FREE(ltdb)
authorStefan Metzmacher <metze@samba.org>
Sat, 3 Sep 2022 23:35:06 +0000 (23:35 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 20 Sep 2022 00:34:35 +0000 (00:34 +0000)
We should free ltdb as soon as possible...

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/locking/share_mode_lock.c

index ba4660b5015e9ecf551c25bec240885615934364..3bcf2b12c793e7c45689cb3e05231a7ea46ebf21 100644 (file)
@@ -2134,6 +2134,7 @@ bool share_mode_forall_entries(
                  (int)writeback);
 
        if (!writeback) {
+               TALLOC_FREE(ltdb);
                return true;
        }
 
@@ -2149,6 +2150,7 @@ bool share_mode_forall_entries(
        ltdb->share_entries = share_entries;
 
        status = locking_tdb_data_store(key, ltdb, NULL, 0);
+       TALLOC_FREE(ltdb);
        if (!NT_STATUS_IS_OK(status)) {
                DBG_ERR("locking_tdb_data_store failed: %s\n",
                        nt_errstr(status));