From fd312fcc78c1741adb68f6f011d7fb39f0ad3979 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Jaroszy=C5=84ski?=
Date: Thu, 8 Jul 2010 15:54:55 +0200
Subject: [PATCH] [image] Fix a memory leak in free_image()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
image_set_cmdline() strdup()s cmdline, which free_image() doesn't
clean up.
Signed-off-by: Piotr JaroszyĆski
Signed-off-by: Stefan Hajnoczi
Signed-off-by: Michael Brown
---
src/core/image.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/core/image.c b/src/core/image.c
index f530cafd..ec4b4610 100644
--- a/src/core/image.c
+++ b/src/core/image.c
@@ -47,6 +47,7 @@ struct list_head images = LIST_HEAD_INIT ( images );
static void free_image ( struct refcnt *refcnt ) {
struct image *image = container_of ( refcnt, struct image, refcnt );
+ free ( image->cmdline );
uri_put ( image->uri );
ufree ( image->data );
image_put ( image->replacement );