summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-12-06 04:46:24 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-12-06 09:28:56 -0800
commit7e1ba386dd51aebe3fb05b5d7b3d9ff42e3fb77a (patch)
tree60c2124c01cb9c3f704607c8a42a1ec1113b1701
parentf57ef39dbd46389dc9763bf291b08a0ba762b707 (diff)
performance/stat-prefetch: fix memory leak.v2.0.9
- rbt_hash_remove only removes entry from the hash table. It does not free the data. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 438 (Memory leak) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=438
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index d5a206aee..0e77abc08 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -373,6 +373,7 @@ sp_cache_remove_entry (sp_cache_t *cache, char *name, char remove_all)
rbthash_table_t *table = NULL;
xlator_t *this;
sp_private_t *priv = NULL;
+ void *data = NULL;
if ((cache == NULL) || ((name == NULL) && !remove_all)) {
goto out;
@@ -404,7 +405,9 @@ sp_cache_remove_entry (sp_cache_t *cache, char *name, char remove_all)
ret = 0;
}
} else {
- rbthash_remove (cache->table, name, strlen (name));
+ data = rbthash_remove (cache->table, name,
+ strlen (name));
+ FREE (data);
ret = 0;
}
}