From f7d78e3cd3628559d0b20745bf085abf97b18160 Mon Sep 17 00:00:00 2001 From: Sunil Kumar Acharya Date: Tue, 31 Oct 2017 15:14:52 +0530 Subject: cluster/ec: FORWARD_NULL coverity fix Problem: xattr could be NULL. Solution: Added check to verify the same. BUG: 789278 Change-Id: Ie013f5655f4621434e5023dd76cef44b976adc68 Signed-off-by: Sunil Kumar Acharya --- xlators/cluster/ec/src/ec-heal.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'xlators/cluster/ec') diff --git a/xlators/cluster/ec/src/ec-heal.c b/xlators/cluster/ec/src/ec-heal.c index d4beabf0682..7d4bed1b185 100644 --- a/xlators/cluster/ec/src/ec-heal.c +++ b/xlators/cluster/ec/src/ec-heal.c @@ -525,11 +525,13 @@ ec_adjust_versions (call_frame_t *frame, ec_t *ec, ec_txn_t type, out: /* Cleanup */ - for (i = 0; i < ec->nodes; i++) { - if (xattr[i]) - dict_unref (xattr[i]); + if (xattr) { + for (i = 0; i < ec->nodes; i++) { + if (xattr[i]) + dict_unref (xattr[i]); + } + GF_FREE (xattr); } - GF_FREE (xattr); cluster_replies_wipe (replies, ec->nodes); loc_wipe (&loc); return op_ret; -- cgit