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

Stefan Hajnoczi stefanha at gmail.com
Sun Jul 11 03:49:25 EDT 2010


2010/7/9 Stefan Hajnoczi <stefanha at gmail.com>:
> 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>
>> ---

Applied, thanks!

http://git.etherboot.org/?p=gpxe.git;a=commitdiff;h=129385afd1a47ff72b38f4bf78f5373b2d36052d

Stefan

>>
>> 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