summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-rebalance.c
diff options
context:
space:
mode:
authorSusant Palai <spalai@redhat.com>2020-05-22 13:47:14 +0530
committerMOHIT AGRAWAL <moagrawa@redhat.com>2020-05-26 03:04:11 +0000
commit66ee6467d9c485dabf0a32b7f282d561bd65ca8b (patch)
tree1e6e525f7189983ec4a714e85c2456df9ac4a91c /xlators/cluster/dht/src/dht-rebalance.c
parent61c4695ea1411feeea7a802c37446bc0df45e31c (diff)
dht: add null check in gf_defrag_free_dir_dfmeta
fixes: #1258 Change-Id: I9d1fb512072bcc540d21d47da5b15ae1b79cf2b8 Signed-off-by: Susant Palai <spalai@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-rebalance.c')
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index 14377070a4f..40951cb0ef7 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -45,7 +45,8 @@ gf_defrag_free_dir_dfmeta(struct dir_dfmeta *meta, int local_subvols_cnt)
if (meta) {
for (i = 0; i < local_subvols_cnt; i++) {
- gf_dirent_free(&meta->equeue[i]);
+ if (meta->equeue)
+ gf_dirent_free(&meta->equeue[i]);
if (meta->lfd && meta->lfd[i])
fd_unref(meta->lfd[i]);
}