summaryrefslogtreecommitdiffstats
path: root/page_cache.c
diff options
context:
space:
mode:
authorChen Gang <gang.chen.5i5j@gmail.com>2014-06-02 20:16:55 +0800
committerMichael Tokarev <mjt@tls.msk.ru>2014-06-10 19:54:43 +0400
commit4380be0e997284159e634100d2f5ec87f944d74d (patch)
tree79ce4b62efdc47559ec396ab986841a3cc17a945 /page_cache.c
parentfec0da9cbf6b357e046cac4295185610399dcbb8 (diff)
downloadhqemu-4380be0e997284159e634100d2f5ec87f944d74d.zip
hqemu-4380be0e997284159e634100d2f5ec87f944d74d.tar.gz
migration: Plug memory leak in migrate-set-cache-size command
We call g_free() after cache_fini() in migration_end(), but we don't call it after cache_fini() in xbzrle_cache_resize(), leaking the memory. cache_init() and cache_fini() are a pair. Since cache_init() allocates the cache, let cache_fini() free it. This plugs the leak. Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
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 b033681..89bb1ec 100644
--- a/page_cache.c
+++ b/page_cache.c
@@ -109,6 +109,7 @@ void cache_fini(PageCache *cache)
g_free(cache->page_cache);
cache->page_cache = NULL;
+ g_free(cache);
}
static size_t cache_get_cache_pos(const PageCache *cache,
OpenPOWER on IntegriCloud