diff options
author | arao <arao@redhat.com> | 2015-02-16 16:59:48 +0530 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2015-07-12 21:56:50 -0700 |
commit | 608a9f24954c716492d9dd69b1e56e439aa66243 (patch) | |
tree | 1435628bc37198ed2c47adf63e2ee2c8b9cbc877 | |
parent | 46d4d7ade012f86044135dd4af3101f851484cda (diff) |
glusterd: Fixing dereference after null check
CID: 1124557
Checking for the pointer itself before dereferencing
it to check for the variable's value it is pointed to.
Change-Id: Idcbb034e4c6d58501697e01e90647b6233a5e5ba
BUG: 789278
Signed-off-by: arao <arao@redhat.com>
Reviewed-on: http://review.gluster.org/9661
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-store.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index 8d6e3d04cb8..4dd94617dd1 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -3752,10 +3752,10 @@ glusterd_store_delete_peerinfo (glusterd_peerinfo_t *peerinfo) ret = 0; out: - if (peerinfo->shandle) { - gf_store_handle_destroy (peerinfo->shandle); - peerinfo->shandle = NULL; - } + if (peerinfo && peerinfo->shandle) { + gf_store_handle_destroy (peerinfo->shandle); + peerinfo->shandle = NULL; + } gf_msg_debug (this->name, 0, "Returning with %d", ret); return ret; |