From cd875c9b2c15ee55e3734ae5578bc617450f1fbd Mon Sep 17 00:00:00 2001 From: Youzhong Yang Date: Tue, 3 Jan 2017 10:28:11 -0500 Subject: [PATCH] s3:locking: leases_db_del() should not crash when there's no record Signed-off-by: Youzhong Yang BUG: https://bugzilla.samba.org/show_bug.cgi?id=12495 --- source3/locking/leases_db.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source3/locking/leases_db.c b/source3/locking/leases_db.c index 4167ef7..b45d61b 100644 --- a/source3/locking/leases_db.c +++ b/source3/locking/leases_db.c @@ -242,12 +242,12 @@ NTSTATUS leases_db_del(const struct GUID *client_guid, rec = dbwrap_fetch_locked(leases_db, talloc_tos(), db_key); TALLOC_FREE(db_key.dptr); if (rec == NULL) { - return NT_STATUS_NOT_FOUND; + return NT_STATUS_INTERNAL_ERROR; } db_value = dbwrap_record_get_value(rec); if (db_value.dsize == 0) { - status = NT_STATUS_INTERNAL_ERROR; - goto out; + TALLOC_FREE(rec); + return NT_STATUS_NOT_FOUND; } value = talloc(rec, struct leases_db_value); -- 1.7.2.5