smbd: Fix an uninitialized variable read
authorVolker Lendecke <vl@samba.org>
Fri, 9 Jan 2015 14:45:41 +0000 (15:45 +0100)
committerRalph Böhme <slow@samba.org>
Sun, 11 Jan 2015 17:12:10 +0000 (18:12 +0100)
If dbwrap_fetch_locked failed, we did a TALLOC_FREE(value). Fix this with a
talloc hierarchy.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/locking/leases_db.c

index 0700ba94b87b3a0f39212ad52439ad0fbc477ab2..eceecd816b08304268ed499999cbe01c6a209b03 100644 (file)
@@ -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;
 }