From 393936aee6f20d85ba2b3e6c59af7c6b8c554a28 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 19 Apr 2012 16:09:41 +0200 Subject: s3: Fix Coverity ID 2682 -- NULL_RETURNS Autobuild-User: Volker Lendecke Autobuild-Date: Thu Apr 19 22:28:34 CEST 2012 on sn-devel-104 --- source3/locking/posix.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source3/locking/posix.c b/source3/locking/posix.c index 463aa21fd8..557099b2d8 100644 --- a/source3/locking/posix.c +++ b/source3/locking/posix.c @@ -457,11 +457,18 @@ void reduce_windows_lock_ref_count(files_struct *fsp, unsigned int dcount) posix_pending_close_db, talloc_tos(), locking_ref_count_key_fsp(fsp, &tmp)); + if (rec == NULL) { + DEBUG(0, ("reduce_windows_lock_ref_count: rec not found\n")); + return; + } + value = dbwrap_record_get_value(rec); - SMB_ASSERT((rec != NULL) - && (value.dptr != NULL) - && (value.dsize == sizeof(lock_ref_count))); + if ((value.dptr == NULL) || (value.dsize != sizeof(lock_ref_count))) { + DEBUG(0, ("reduce_windows_lock_ref_count: wrong value\n")); + TALLOC_FREE(rec); + return; + } memcpy(&lock_ref_count, value.dptr, sizeof(lock_ref_count)); -- cgit