From 6eee473eba94697953e8b3e1b04fe5ef1de5f474 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 5 Jun 2012 14:15:54 +0530 Subject: core: coverity fixes (mostly resource leak fixes) currently working on obvious resource leak reports in coverity Change-Id: I261f4c578987b16da399ab5a504ad0fda0b176b1 Signed-off-by: Amar Tumballi BUG: 789278 Reviewed-on: http://review.gluster.com/3265 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/cluster/stripe/src/stripe-helpers.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'xlators/cluster/stripe/src/stripe-helpers.c') diff --git a/xlators/cluster/stripe/src/stripe-helpers.c b/xlators/cluster/stripe/src/stripe-helpers.c index a2ebc1201f7..1821832c20e 100644 --- a/xlators/cluster/stripe/src/stripe-helpers.c +++ b/xlators/cluster/stripe/src/stripe-helpers.c @@ -471,12 +471,16 @@ set_stripe_block_size (xlator_t *this, stripe_private_t *priv, char *data) temp_stripeopt = NULL; else temp_stripeopt = priv->pattern; - priv->pattern = stripe_opt; + stripe_opt->next = temp_stripeopt; - stripe_str = strtok_r (NULL, ",", &tmp_str); + priv->pattern = stripe_opt; + stripe_opt = NULL; + GF_FREE (dup_str); dup_str = NULL; + + stripe_str = strtok_r (NULL, ",", &tmp_str); } ret = 0; @@ -485,6 +489,9 @@ out: if (dup_str) GF_FREE (dup_str); + if (stripe_opt) + GF_FREE (stripe_opt); + return ret; } -- cgit