Blob Blame History Raw
From 6bcc18bf4f3f36b0cebed9c8645d7e1453fcdc73 Mon Sep 17 00:00:00 2001
From: N Balachandran <nbalacha@redhat.com>
Date: Fri, 30 Dec 2016 10:33:13 +0530
Subject: [PATCH 519/525] cluster/dht: Fix dict_leak in migration check tasks

Fixed a memleak where dict was not being unrefed
in the dht_migration_complete_check_task and
dht_rebalance_inprogress_task functions.

> BUG: 1409186
> Signed-off-by: N Balachandran <nbalacha@redhat.com>
> Reviewed-on: http://review.gluster.org/16308
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: MOHIT AGRAWAL <moagrawa@redhat.com>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>

Change-Id: I3d42e9a2e5c8596c985bf6431a68fd3905227383
BUG: 1462066
Signed-off-by: N Balachandran <nbalacha@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/109329
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
---
 xlators/cluster/dht/src/dht-helper.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c
index 40c6eb5..f6cbe2c 100644
--- a/xlators/cluster/dht/src/dht-helper.c
+++ b/xlators/cluster/dht/src/dht-helper.c
@@ -1319,6 +1319,9 @@ unlock:
         UNLOCK(&inode->lock);
 
 out:
+        if (dict) {
+                dict_unref (dict);
+        }
 
         loc_wipe (&tmp_loc);
 
@@ -1587,6 +1590,10 @@ unlock:
 
         ret = 0;
 out:
+        if (dict) {
+                dict_unref (dict);
+        }
+
         loc_wipe (&tmp_loc);
         return ret;
 }
-- 
1.8.3.1