summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-07-09 07:51:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:52 -0500
commit4ff7e6dbc92d77ccaa1805d03486e19b72ec7d26 (patch)
treef615d8ece93937966b5e01c78eeadc7b5351c640 /source3/locking
parent59590a1c4dc9bebc0e3a4ff6b0db9beb6ea81fef (diff)
downloadsamba-4ff7e6dbc92d77ccaa1805d03486e19b72ec7d26.tar.gz
samba-4ff7e6dbc92d77ccaa1805d03486e19b72ec7d26.tar.bz2
samba-4ff7e6dbc92d77ccaa1805d03486e19b72ec7d26.zip
r23755: Fix Coverity id 384
(This used to be commit ebb410ca1e08d6f062154c9f8b3970682c6eeebd)
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/brlock.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c
index 202fab36cc..9b8dcfd15e 100644
--- a/source3/locking/brlock.c
+++ b/source3/locking/brlock.c
@@ -1642,7 +1642,13 @@ static struct byte_range_lock *brl_get_locks_internal(TALLOC_CTX *mem_ctx,
talloc_set_destructor(br_lck, byte_range_lock_destructor);
br_lck->num_locks = data.dsize / sizeof(struct lock_struct);
- br_lck->lock_data = SMB_MALLOC_ARRAY(struct lock_struct, br_lck->num_locks);
+ if (!(br_lck->lock_data = SMB_MALLOC_ARRAY(
+ struct lock_struct, br_lck->num_locks))) {
+ DEBUG(0, ("malloc failed\n"));
+ TALLOC_FREE(br_lck);
+ return NULL;
+ }
+
memcpy(br_lck->lock_data, data.dptr, data.dsize);
if (!fsp->lockdb_clean) {