From 3815b49a7567dc67b993cae47aa06c49551720eb Mon Sep 17 00:00:00 2001 From: Eunhae Choi Date: Fri, 9 Dec 2016 13:48:53 +0900 Subject: [PATCH] [pulsesink/monoscope] fix memory leak Change-Id: Ib3491bf57df811967ce8d0e17375bb142f6854e2 --- ext/pulse/pulsesink.c | 5 ++++- gst/monoscope/gstmonoscope.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c index 36e6cdb..30fd393 100644 --- a/ext/pulse/pulsesink.c +++ b/ext/pulse/pulsesink.c @@ -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__ */ diff --git a/gst/monoscope/gstmonoscope.c b/gst/monoscope/gstmonoscope.c index 4632aa4..07119ce 100644 --- a/gst/monoscope/gstmonoscope.c +++ b/gst/monoscope/gstmonoscope.c @@ -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; -- 2.7.4