dmxVDLRead: if we opened a file, close it instead of leaking it
authorAlan Coopersmith <alan.coopersmith@oracle.com>
Sun, 10 Feb 2013 18:18:02 +0000 (10:18 -0800)
committerAlan Coopersmith <alan.coopersmith@oracle.com>
Wed, 24 Apr 2013 21:22:36 +0000 (14:22 -0700)
Reported with other leaks found by cppcheck in bugzilla #50281
https://bugs.freedesktop.org/show_bug.cgi?id=50281

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
hw/dmx/config/dmxcompat.c

index bd9f127..107991a 100644 (file)
@@ -228,5 +228,9 @@ dmxVDLRead(const char *filename)
             break;
         }
     }
+
+    if (str != stdin)
+        fclose(str);
+
     return entry;
 }