]> git.proxmox.com Git - mirror_qemu.git/commit - page_cache.c
migration: Plug memory leak in migrate-set-cache-size command
authorChen Gang <gang.chen.5i5j@gmail.com>
Mon, 2 Jun 2014 12:16:55 +0000 (20:16 +0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 10 Jun 2014 15:54:43 +0000 (19:54 +0400)
commit4380be0e997284159e634100d2f5ec87f944d74d
tree79ce4b62efdc47559ec396ab986841a3cc17a945
parentfec0da9cbf6b357e046cac4295185610399dcbb8
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>
arch_init.c
page_cache.c