]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
perf header: Fix double fclose() on do_write(fd, xxx) failure
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 28 Jan 2013 09:21:14 +0000 (10:21 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 30 Jan 2013 13:40:44 +0000 (10:40 -0300)
commit5809fde040de2afa477a6c593ce2e8fd2c11d9d3
treeb6ff202ebeca4341a1332258a04403f8ce95e75a
parentfdae6373910c10e27b8ae07e11e821b183d0bba5
perf header: Fix double fclose() on do_write(fd, xxx) failure

cppcheck reported:
[util/header.c:983]: (error) Used file that is not opened.

Thanks to Arnaldo Carvalho de Melo for pointing out that
fclose(NULL) is undefined behavior -> protect against it.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Link: http://lkml.kernel.org/r/1751778.SZQB4fNdIh@storm
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/header.c