[image] Fix a memleak in free_image()
authorPiotr Jaroszyński <p.jaroszynski@gmail.com>
Thu, 8 Jul 2010 13:54:55 +0000 (15:54 +0200)
committerStefan Hajnoczi <stefanha@gmail.com>
Sun, 11 Jul 2010 07:46:16 +0000 (08:46 +0100)
image_set_cmdline() strdup()s cmdline, which free_image() doesn't clean
up.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
src/core/image.c

index e29d4cc..d7fed72 100644 (file)
@@ -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 );