[gPXE-devel] [PATCH] [image] Fix a memleak in free_image()

Stefan Hajnoczi stefanha at gmail.com
Fri Jul 9 01:56:42 EDT 2010


Looks good.

Stefan

2010/7/8 Piotr Jaroszyński <p.jaroszynski at gmail.com>:
> image_set_cmdline() strdup()s cmdline, which free_image() doesn't clean
> up.
>
> Signed-off-by: Piotr Jaroszyński <p.jaroszynski at gmail.com>
> ---
>
> Another thing found by valgrind.
>
>  src/core/image.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/src/core/image.c b/src/core/image.c
> index e29d4cc..d7fed72 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 );
> --
> 1.7.1
>
> _______________________________________________
> gPXE-devel mailing list
> gPXE-devel at etherboot.org
> http://etherboot.org/mailman/listinfo/gpxe-devel
>


More information about the gPXE-devel mailing list