stats: always free log
authorLuis de Bethencourt <luisbg@osg.samsung.com>
Tue, 20 Oct 2015 12:46:24 +0000 (13:46 +0100)
committerLuis de Bethencourt <luisbg@osg.samsung.com>
Wed, 21 Oct 2015 10:19:14 +0000 (11:19 +0100)
We always want to free the open file log if fopen() succeeded. Independently
of if fgets() succeeds or fails.

CID 1326055

https://bugzilla.gnome.org/show_bug.cgi?id=756864

tools/gst-stats.c

index 3ee39a5..f5efdda 100644 (file)
@@ -836,10 +836,10 @@ collect_stats (const gchar * filename)
           }
         }
       }
-      fclose (log);
     } else {
       GST_WARNING ("empty log");
     }
+    fclose (log);
   }
 }