Blob Blame History Raw
From ad97c25ea8678a486c464b76e23cf319f8119c43 Mon Sep 17 00:00:00 2001
From: Vijay Bellur <vbellur@redhat.com>
Date: Wed, 3 Jun 2015 23:43:55 +0530
Subject: [PATCH 33/57] features/marker: Cleanup loc in case of errors

This is a backport of http://review.gluster.org/#/c/11074/

> Missing loc_wipe() for error paths in mq_readdir_cbk() can
> cause memory leaks. loc_wipe() is now done for both happy
> and unhappy paths.
>
> Change-Id: I882aa5dcca06e25b56a828767fb2b91a1efaf83b
> BUG: 1227904
> Signed-off-by: Vijay Bellur <vbellur@redhat.com>
> Reviewed-on: http://review.gluster.org/11074
> Reviewed-by: Sachin Pandit <spandit@redhat.com>
> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
> Tested-by: Gluster Build System <jenkins@build.gluster.com>
> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
> Tested-by: Raghavendra G <rgowdapp@redhat.com>

Change-Id: I9da333b701eaace7f492280386e7ded4459f442f
BUG: 1229612
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/50309
Reviewed-by: Raghavendra Gowdappa <rgowdapp@redhat.com>
Tested-by: Raghavendra Gowdappa <rgowdapp@redhat.com>
---
 xlators/features/marker/src/marker-quota.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c
index e9351ed..ef70236 100644
--- a/xlators/features/marker/src/marker-quota.c
+++ b/xlators/features/marker/src/marker-quota.c
@@ -665,12 +665,10 @@ mq_readdir_cbk (call_frame_t *frame,
                             &loc, dict);
 
                 offset = entry->d_off;
-
-                loc_wipe (&loc);
-
                 newframe = NULL;
 
         out:
+                loc_wipe (&loc);
                 if (dict) {
                         dict_unref (dict);
                         dict = NULL;
-- 
1.7.1