[pulsesink/monoscope] fix memory leak 75/106075/1
authorEunhae Choi <eunhae1.choi@samsung.com>
Fri, 9 Dec 2016 04:48:53 +0000 (13:48 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Tue, 20 Dec 2016 10:08:27 +0000 (19:08 +0900)
Change-Id: Ib3491bf57df811967ce8d0e17375bb142f6854e2

ext/pulse/pulsesink.c
gst/monoscope/gstmonoscope.c

index 36e6cdb..30fd393 100644 (file)
@@ -2469,7 +2469,10 @@ gst_pulsesink_init (GstPulseSink * pulsesink)
   pulsesink->dump_fd_input = NULL;
   if (pulsesink->need_dump_input) {
     sinkpad = gst_element_get_static_pad((GstElement *)pulsesink, "sink");
-    gst_pad_add_buffer_probe (sinkpad, G_CALLBACK (gst_pulsesink_pad_dump_handler), pulsesink);
+    if (sinkpad) {
+      gst_pad_add_buffer_probe (sinkpad, G_CALLBACK (gst_pulsesink_pad_dump_handler), pulsesink);
+      gst_object_unref (GST_OBJECT(sinkpad));
+    }
   }
 #endif
 #endif /* __TIZEN__ */
index 4632aa4..07119ce 100644 (file)
@@ -291,6 +291,7 @@ gst_monoscope_src_negotiate (GstMonoscope * monoscope)
   /* and activate */
   gst_buffer_pool_set_active (pool, TRUE);
 
+  gst_query_unref (query);
   gst_caps_unref (target);
 
   return TRUE;