gst-play: fix memory leak
authorVineeth TM <vineeth.tm@samsung.com>
Mon, 6 Jul 2015 23:53:09 +0000 (08:53 +0900)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 7 Jul 2015 08:26:03 +0000 (09:26 +0100)
In gst-play, for GST_MESSAGE_ELEMENT bus message,
event is being allocated through
gst_navigation_message_parse_event, but not freed.

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

tools/gst-play.c

index 8b299a0..9b9fe06 100644 (file)
@@ -391,7 +391,7 @@ play_bus_msg (GstBus * bus, GstMessage * msg, gpointer user_data)
     {
       GstNavigationMessageType mtype = gst_navigation_message_get_type (msg);
       if (mtype == GST_NAVIGATION_MESSAGE_EVENT) {
-        GstEvent *ev;
+        GstEvent *ev = NULL;
 
         if (gst_navigation_message_parse_event (msg, &ev)) {
           GstNavigationEventType e_type = gst_navigation_event_get_type (ev);
@@ -439,6 +439,8 @@ play_bus_msg (GstBus * bus, GstMessage * msg, gpointer user_data)
               break;
           }
         }
+        if (ev)
+          gst_event_unref (ev);
       }
       break;
     }