From: Stefan Metzmacher Date: Sat, 3 Sep 2022 23:35:06 +0000 (+0000) Subject: s3:locking: let share_mode_forall_entries() call TALLOC_FREE(ltdb) X-Git-Tag: talloc-2.4.0~907 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db78fe13a37d7143f622d8f2e710f2ebd2d97abc;p=thirdparty%2Fsamba.git s3:locking: let share_mode_forall_entries() call TALLOC_FREE(ltdb) We should free ltdb as soon as possible... BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index ba4660b5015..3bcf2b12c79 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -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));