summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-helper.c
diff options
context:
space:
mode:
authorAshish Pandey <aspandey@redhat.com>2017-11-04 19:20:35 +0530
committerAmar Tumballi <amarts@redhat.com>2017-11-06 07:05:31 +0000
commitaf8604d5e9826df57aee7aba235d2e77a7e7f8fb (patch)
tree236089e44c68340bc93cae1596ffec784a0d5791 /xlators/cluster/dht/src/dht-helper.c
parentf461d75b226a5bc6c088280e43a96f9b54f33af5 (diff)
cluster/dht: Check for NULL before using variable
Coverity ID: 245 Check statvfs received as cbk before using it Coverity ID: 228 Check NULL loc before freeing it. Change-Id: I1b153ed5e7b81bcf7033bf710808e95908dcfef4 BUG: 789278 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-helper.c')
-rw-r--r--xlators/cluster/dht/src/dht-helper.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c
index 5c3d37ad104..0c249f0e84c 100644
--- a/xlators/cluster/dht/src/dht-helper.c
+++ b/xlators/cluster/dht/src/dht-helper.c
@@ -1158,7 +1158,9 @@ dht_build_child_loc (xlator_t *this, loc_t *child, loc_t *parent, char *name)
return 0;
err:
- loc_wipe (child);
+ if (child) {
+ loc_wipe (child);
+ }
return -1;
}