Patchwork [1/4] Fix page_cache leak in cache_resize

login
register
mail settings
Submitter Orit Wasserman
Date Feb. 25, 2013, 1:19 p.m.
Message ID <1361798382-6515-2-git-send-email-owasserm@redhat.com>
Download mbox | patch
Permalink /patch/222919/
State New
Headers show

Comments

Orit Wasserman - Feb. 25, 2013, 1:19 p.m.
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
---
 page_cache.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/page_cache.c b/page_cache.c
index ba5640b..748957b 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;