]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[image] Fix a memory leak in free_image()
authorPiotr Jaroszyński <p.jaroszynski@gmail.com>
Thu, 8 Jul 2010 13:54:55 +0000 (15:54 +0200)
committerMichael Brown <mcb30@ipxe.org>
Sun, 11 Jul 2010 14:55:04 +0000 (15:55 +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>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/image.c

index f530cafd4bec44109ecbe899d795b0020f39f253..ec4b461064ea324b9252b577131b96023d061d27 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 );