summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-04-13 17:29:41 +0530
committerAnand Avati <avati@redhat.com>2012-04-23 14:52:57 -0700
commit29f2de478cc6a475e6ae760d9cbe7ac847e9d79c (patch)
tree621fbb33e6e3de20f7c1b59a98e181c7b50b4796 /xlators/cluster
parent4c9e8fad23836d87b0c4327e990c789630fe5b97 (diff)
core: coverity issues fixed
this is not a complete set of issues getting fixed. Will address other issues in another patch. Change-Id: Ib01c7b11b205078cc4d0b3f11610751e32d14b69 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 789278 Reviewed-on: http://review.gluster.com/3145 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/dht/src/dht-layout.c3
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c3
-rw-r--r--xlators/cluster/stripe/src/stripe-helpers.c6
-rw-r--r--xlators/cluster/stripe/src/stripe.c2
4 files changed, 12 insertions, 2 deletions
diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c
index d1f8c9fbb..3c583c7bd 100644
--- a/xlators/cluster/dht/src/dht-layout.c
+++ b/xlators/cluster/dht/src/dht-layout.c
@@ -280,6 +280,9 @@ dht_disk_layout_extract (xlator_t *this, dht_layout_t *layout,
if (disk_layout_p)
*disk_layout_p = disk_layout;
+ else
+ GF_FREE (disk_layout);
+
ret = 0;
out:
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index 420af4b7f..9c8aeac25 100644
--- a/xlators/cluster/dht/src/dht-selfheal.c
+++ b/xlators/cluster/dht/src/dht-selfheal.c
@@ -706,6 +706,9 @@ done:
local->layout = new_layout;
}
+ if (fix_array)
+ GF_FREE (fix_array);
+
return new_layout;
}
diff --git a/xlators/cluster/stripe/src/stripe-helpers.c b/xlators/cluster/stripe/src/stripe-helpers.c
index ed7ed1a0b..dcd2022f7 100644
--- a/xlators/cluster/stripe/src/stripe-helpers.c
+++ b/xlators/cluster/stripe/src/stripe-helpers.c
@@ -440,7 +440,6 @@ set_stripe_block_size (xlator_t *this, stripe_private_t *priv, char *data)
stripe_opt = GF_CALLOC (1, sizeof (struct stripe_options),
gf_stripe_mt_stripe_options);
if (!stripe_opt) {
- GF_FREE (dup_str);
goto out;
}
@@ -486,10 +485,15 @@ set_stripe_block_size (xlator_t *this, stripe_private_t *priv, char *data)
stripe_str = strtok_r (NULL, ",", &tmp_str);
GF_FREE (dup_str);
+ dup_str = NULL;
}
ret = 0;
out:
+
+ if (dup_str)
+ GF_FREE (dup_str);
+
return ret;
}
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index 86cc66f59..627e17dca 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -4470,7 +4470,7 @@ stripe_vgetxattr_cbk (call_frame_t *frame, void *cookie,
local = frame->local;
cky = (long) cookie;
- if (!local->xsel) {
+ if (local->xsel[0] == '\0') {
gf_log (this->name, GF_LOG_ERROR, "Empty xattr in cbk");
return ret;
}