[PATCH:libXpm] Close fd if fdopen() or xpmPipeThrough() fails in OpenWriteFile()

Mark Kettenis mark.kettenis at xs4all.nl
Mon Apr 22 13:51:24 PDT 2013


> From: Alan Coopersmith <alan.coopersmith at oracle.com>
> Date: Mon, 22 Apr 2013 13:25:57 -0700
> 
> Fixes leak found by parfait 1.1 bug checking tool:
>    File Descriptor Leak: Leaked File Descriptor fd
>         at line 350 of lib/libXpm/src/WrFFrI.c in function 'OpenWriteFile'.
>           fd initialized at line 332 with open
>           fd leaks when strcmp(".Z", (filename + (len - 2))) != 0 at line 337
>               and strcmp(".gz", (filename + (len - 3))) != 0 at line 340.
> 
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

Reviewed-by: Mark Kettenis <kettenis at openbsd.org>

> ---
>  src/WrFFrI.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)


More information about the xorg-devel mailing list