From b584c068c6526853f82ccd2a406c3596d7d56be0 Mon Sep 17 00:00:00 2001 From: Nigel Babu Date: Sat, 18 Feb 2017 14:02:30 +0530 Subject: libglusterfs, dht, locks, glusterd: Coverity fixes Fix up use after free bugs and dead code Change-Id: I8f79ed6b5108926c1fac31c147b5ecba79d10785 BUG: 1424905 Signed-off-by: Nigel Babu Reviewed-on: https://review.gluster.org/16666 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee Reviewed-by: Shyamsundar Ranganathan --- xlators/features/locks/src/posix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators/features/locks/src/posix.c') diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index 0e75ad889be..5d79fa16a66 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -2840,6 +2840,7 @@ new_meta_lock (call_frame_t *frame, xlator_t *this) gf_msg (this->name, GF_LOG_ERROR, 0, ENOMEM, "mem allocation" " failed for client_uid"); GF_FREE (lock); + lock = NULL; goto out; } @@ -3808,7 +3809,8 @@ gf_lkmig_info_to_posix_lock (call_frame_t *frame, lock->client_uid = gf_strdup (lmi->client_uid); if (lock->client_uid == NULL) { GF_FREE (lock); - goto out; + lock = NULL; + goto out; } lock->client_pid = lmi->flock.l_pid; -- cgit