From 7dceb3a2df49101cd940f7cd1b2798c81dd4e9d9 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 9 Jan 2015 15:45:41 +0100 Subject: [PATCH] smbd: Fix an uninitialized variable read If dbwrap_fetch_locked failed, we did a TALLOC_FREE(value). Fix this with a talloc hierarchy. Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- source3/locking/leases_db.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source3/locking/leases_db.c b/source3/locking/leases_db.c index 0700ba94b87..eceecd816b0 100644 --- a/source3/locking/leases_db.c +++ b/source3/locking/leases_db.c @@ -243,7 +243,7 @@ NTSTATUS leases_db_del(const struct GUID *client_guid, goto out; } - value = talloc(talloc_tos(), struct leases_db_value); + value = talloc(rec, struct leases_db_value); if (value == NULL) { status = NT_STATUS_NO_MEMORY; goto out; @@ -308,7 +308,6 @@ NTSTATUS leases_db_del(const struct GUID *client_guid, out: - TALLOC_FREE(value); TALLOC_FREE(rec); return status; } -- 2.11.4.GIT