aboutsummaryrefslogtreecommitdiff
path: root/page_cache.c
diff options
context:
space:
mode:
authorOrit Wasserman <owasserm@redhat.com>2013-02-25 19:12:01 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2013-04-02 15:44:02 -0500
commit5610ef5863a7834f0680f520beb8c48b2dc107e4 (patch)
tree071f329101abbca357da9bff2b1b7c7147f35048 /page_cache.c
parent7a687aed28c216e7779661124c066b80e1e54fb1 (diff)
Fix page_cache leak in cache_resize
Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Juan Quintela <quintela@redhat.com> (cherry picked from commit 0db65d624e0211a43c011579d6607a50d8f06082) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'page_cache.c')
-rw-r--r--page_cache.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/page_cache.c b/page_cache.c
index ba5640bd73..748957bc42 100644
--- a/page_cache.c
+++ b/page_cache.c
@@ -208,6 +208,7 @@ int64_t cache_resize(PageCache *cache, int64_t new_num_pages)
}
}
+ g_free(cache->page_cache);
cache->page_cache = new_cache->page_cache;
cache->max_num_items = new_cache->max_num_items;
cache->num_items = new_cache->num_items;