summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorSunil Kumar Acharya <sheggodu@redhat.com>2017-10-31 15:14:52 +0530
committerXavier Hernandez <jahernan@redhat.com>2017-11-07 15:50:28 +0000
commitf7d78e3cd3628559d0b20745bf085abf97b18160 (patch)
treed5c241f8f20781f5515736b295cf73482462a3aa /xlators/cluster
parente3d5587a267106fc7fa728f29a12dc199a539202 (diff)
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 <sheggodu@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/ec/src/ec-heal.c10
1 files changed, 6 insertions, 4 deletions
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;