From 6bca0184d167388cd417d113031317990489987d Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 10 Feb 2013 10:18:02 -0800 Subject: [PATCH] dmxVDLRead: if we opened a file, close it instead of leaking it Reported with other leaks found by cppcheck in bugzilla #50281 https://bugs.freedesktop.org/show_bug.cgi?id=50281 Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard --- hw/dmx/config/dmxcompat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/dmx/config/dmxcompat.c b/hw/dmx/config/dmxcompat.c index bd9f12738..107991a96 100644 --- a/hw/dmx/config/dmxcompat.c +++ b/hw/dmx/config/dmxcompat.c @@ -228,5 +228,9 @@ dmxVDLRead(const char *filename) break; } } + + if (str != stdin) + fclose(str); + return entry; }