diff options
author | Nigel Babu <nigelb@redhat.com> | 2017-02-18 14:02:30 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-02-23 07:14:33 -0500 |
commit | b584c068c6526853f82ccd2a406c3596d7d56be0 (patch) | |
tree | 1286f0ae23df7c54a19261bbdecad55e19dfce43 /xlators/features | |
parent | afe3a0d2869b706a3d5257f39d6acb9cbe856b87 (diff) |
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 <nigelb@redhat.com>
Reviewed-on: https://review.gluster.org/16666
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'xlators/features')
-rw-r--r-- | xlators/features/locks/src/common.c | 1 | ||||
-rw-r--r-- | xlators/features/locks/src/posix.c | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c index 796b538f6f2..8cdff0d61ef 100644 --- a/xlators/features/locks/src/common.c +++ b/xlators/features/locks/src/common.c @@ -480,6 +480,7 @@ new_posix_lock (struct gf_flock *flock, client_t *client, pid_t client_pid, lock->client_uid = gf_strdup (client->client_uid); if (lock->client_uid == NULL) { GF_FREE (lock); + lock = NULL; goto out; } 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; |