[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: copy-file: Add missing free
From: |
Pádraig Brady |
Subject: |
Re: copy-file: Add missing free |
Date: |
Thu, 15 Oct 2015 19:43:08 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
On 15/10/15 16:16, Simon Reinhardt wrote:
> Dear list,
>
> q?copy_file_preserving is leaking a block, each time it is called with a
> bogus filename:
>
> #include <config.h>
> #include <copy-file.h>
>
> int
> main (void)
> {
> qcopy_file_preserving ("/tmp/some_non_existent_file", "/tmp/vlevle");
> }
>
> will produce in valgrind:
>
> ==5703== 32,768 bytes in 1 blocks are definitely lost in loss record 1 of 1
> ==5703== at 0x4C28C20: malloc (vg_replace_malloc.c:296)
> ==5703== by 0x402C0D: xmalloc (xmalloc.c:41)
> ==5703== by 0x400EB4: qcopy_file_preserving (copy-file.c:61)
> ==5703== by 0x400E88: main (copy-file.c:7)
>
> Attached a fix that adds the missing call to free.
Nice one! Pushed.
thanks,
Pádraig.