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.