summaryrefslogtreecommitdiffstats
path: root/xlators/performance/stat-prefetch/src
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-12-06 04:39:13 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-12-06 02:30:21 -0800
commitbf23224e5dc2af09efd0888490f7af191052c874 (patch)
tree606280628bb506ad819af5df691ae2fe70fb5341 /xlators/performance/stat-prefetch/src
parent4d8c682181822834f46adaa6afea029556a0bb59 (diff)
performance/stat-prefetch: fix memory leak.
- 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
Diffstat (limited to 'xlators/performance/stat-prefetch/src')
-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 729924ff893..7722c7bc8b3 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -377,6 +377,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;
@@ -408,7 +409,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;
}
}