Skip to content

Commit

Permalink
afr/changelog: fix NULL dereferences and error handling
Browse files Browse the repository at this point in the history
This patch includes the following CID from Coverity Scan:
 *1419116
 *1420206

Change-Id: Id92fd6a78c8a00726a61aa4697b5c126ced8ed4d
Updates: #1202
  • Loading branch information
aspandey authored and mohit84 committed May 26, 2020
1 parent 177cc09 commit 61c4695
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion xlators/cluster/afr/src/afr-self-heal-common.c
Expand Up @@ -1909,7 +1909,8 @@ afr_selfheal_unlocked_discover(call_frame_t *frame, inode_t *inode, uuid_t gfid,
dict_t *dict = NULL;

local = frame->local;
if (local && local->xattr_req)

if (local->xattr_req)
dict = local->xattr_req;

return afr_selfheal_unlocked_discover_on(frame, inode, gfid, replies,
Expand Down
18 changes: 9 additions & 9 deletions xlators/features/changelog/src/changelog.c
Expand Up @@ -2036,20 +2036,20 @@ notify(xlator_t *this, int event, void *data, ...)
priv->notify_down = _gf_true;
}
UNLOCK(&priv->lock);
list_for_each_entry_safe(listener, next, &priv->rpc->listeners,
list)
{
if (listener->trans) {
rpc_transport_unref(listener->trans);
if (priv->rpc) {
list_for_each_entry_safe(listener, next,
&priv->rpc->listeners, list)
{
if (listener->trans) {
rpc_transport_unref(listener->trans);
}
}
rpcsvc_destroy(priv->rpc);
priv->rpc = NULL;
}
CHANGELOG_MAKE_SOCKET_PATH(priv->changelog_brick, sockfile,
UNIX_PATH_MAX);
sys_unlink(sockfile);
if (priv->rpc) {
rpcsvc_destroy(priv->rpc);
priv->rpc = NULL;
}
if (!cleanup_notify)
default_notify(this, GF_EVENT_PARENT_DOWN, data);
}
Expand Down

0 comments on commit 61c4695

Please sign in to comment.