diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2019-04-26 08:47:12 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2019-04-26 13:15:36 +0000 |
commit | 13e1fe6dbd39ef88cadce1590b5d4c45b67387cb (patch) | |
tree | 23e3cf1e4bfe2bacdd2fb15d597eb4c839adda65 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 146e4b45d0ce906ae50fd6941a1efafd133897ea (diff) |
glusterd: coverity fixes
1400775 - USE_AFTER_FREE
1400742 - Missing Unlock
1400736 - CHECKED_RETURN
1398470 - Missing Unlock
Missing unlock is the tricky one, we have had annotation added, but
coverity still continued to complaint. Added pthread_mutex_unlock to
clean up the lock before destroying it to see if it makes coverity
happy.
Updates: bz#789278
Change-Id: I1d892612a17f805144d96c1b15004a85a1639414
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 626c9913d7a..4f0eb32ff48 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -5617,7 +5617,13 @@ attach_brick_callback(struct rpc_req *req, struct iovec *iov, int count, /* PID file is copied once brick has attached successfully */ - glusterd_copy_file(pidfile1, pidfile2); + ret = glusterd_copy_file(pidfile1, pidfile2); + if (ret) { + gf_msg(this->name, GF_LOG_ERROR, ENOMEM, GD_MSG_NO_MEMORY, + "Could not copy file %s to %s", pidfile1, pidfile2); + goto out; + } + brickinfo->status = GF_BRICK_STARTED; brickinfo->rpc = rpc_clnt_ref(other_brick->rpc); gf_log(THIS->name, GF_LOG_INFO, "brick %s is attached successfully", |