summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-04-19 16:09:41 +0200
committerVolker Lendecke <vl@samba.org>2012-04-19 22:28:34 +0200
commit393936aee6f20d85ba2b3e6c59af7c6b8c554a28 (patch)
treeeab8bd6042fcd69d22549e0d41784959680ad481
parent3f18316358c15fc13ca676b497c7f510b1d5bd85 (diff)
downloadsamba-393936aee6f20d85ba2b3e6c59af7c6b8c554a28.tar.gz
samba-393936aee6f20d85ba2b3e6c59af7c6b8c554a28.tar.bz2
samba-393936aee6f20d85ba2b3e6c59af7c6b8c554a28.zip
s3: Fix Coverity ID 2682 -- NULL_RETURNS
Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Thu Apr 19 22:28:34 CEST 2012 on sn-devel-104
-rw-r--r--source3/locking/posix.c13
1 files 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));