[gst-debugger/mkolny/fix-memleaks] debugserver: fix memory leaks
- From: Marcin Kolny <mkolny src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gst-debugger/mkolny/fix-memleaks] debugserver: fix memory leaks
- Date: Wed, 4 Oct 2017 20:24:01 +0000 (UTC)
commit f8e169acbc99e10bab29258fcf82bec52fd69cbe
Author: Marcin Kolny <marcin kolny gmail com>
Date: Wed Oct 4 21:23:42 2017 +0100
debugserver: fix memory leaks
src/debugserver/gstdebugserver.c | 9 ++++++++-
src/debugserver/gstdebugservertopology.c | 6 +++++-
src/debugserver/gstdebugservertypes.c | 2 ++
3 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/debugserver/gstdebugserver.c b/src/debugserver/gstdebugserver.c
index a365f85..de28d96 100644
--- a/src/debugserver/gstdebugserver.c
+++ b/src/debugserver/gstdebugserver.c
@@ -444,10 +444,10 @@ static void gst_debugserver_command_handler (GstDebugger__Command * command,
GstDebugger__GStreamerData data = GST_DEBUGGER__GSTREAMER_DATA__INIT;
GstDebugger__PadDynamicInfo pad_info = GST_DEBUGGER__PAD_DYNAMIC_INFO__INIT;
GstPad *pad = gst_utils_get_pad_from_path (GST_ELEMENT_CAST (self->pipeline), command->pad_dynamic_info);
- GstCaps *allowed_caps = gst_pad_get_allowed_caps (pad);
if (pad == NULL) {
break;
}
+ GstCaps *allowed_caps = gst_pad_get_allowed_caps (pad);
GstCaps *current_caps = gst_pad_get_current_caps (pad);
gchar *allowed_caps_str = gst_caps_to_string (allowed_caps);
gchar *current_caps_str = gst_caps_to_string (current_caps);
@@ -461,6 +461,13 @@ static void gst_debugserver_command_handler (GstDebugger__Command * command,
g_free (allowed_caps_str);
g_free (current_caps_str);
+
+ if (current_caps) {
+ gst_caps_unref (current_caps);
+ }
+ if (allowed_caps) {
+ gst_caps_unref (allowed_caps);
+ }
}
case GST_DEBUGGER__COMMAND__COMMAND_TYPE__NOT_SET:
// TODO: error
diff --git a/src/debugserver/gstdebugservertopology.c b/src/debugserver/gstdebugservertopology.c
index 59c0c0a..186a7be 100644
--- a/src/debugserver/gstdebugservertopology.c
+++ b/src/debugserver/gstdebugservertopology.c
@@ -79,7 +79,8 @@ send_object (GstObject *object, GstDebugger__Action action, GstDebugserverTcp *
gst_debugserver_tcp_send_packet (server, client, &info);
g_free (template.caps);
-
+ g_free (pad_tp.path);
+ g_free (element_tp.path);
}
static void
@@ -119,6 +120,9 @@ send_link (GstPad *src_pad, GstPad *sink_pad, GstDebugger__Action action, GstDeb
info.topology_info = &topology;
gst_debugserver_tcp_send_packet (server, client, &info);
+
+ g_free (link_tp.src_pad);
+ g_free (link_tp.sink_pad);
}
static void
diff --git a/src/debugserver/gstdebugservertypes.c b/src/debugserver/gstdebugservertypes.c
index ee3a767..6a6f5ac 100644
--- a/src/debugserver/gstdebugservertypes.c
+++ b/src/debugserver/gstdebugservertypes.c
@@ -211,11 +211,13 @@ static void gst_debugserver_types_send_klass (GstDebugserverTcp *tcp_server, Tcp
gst_debugserver_tcp_send_packet (tcp_server, client, &gst_data);
for (i = 0; i < (gint) n_specs; i++) {
+ g_free (properties_info[i]->default_value->data.data);
g_free (properties_info[i]->default_value);
g_free (properties_info[i]);
}
g_free (properties_info);
+ g_free (specs);
}
void gst_debugserver_types_send_type (GstDebugserverTcp *tcp_server, TcpClient *client, const
GstDebugger__TypeDescriptionRequest *request)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]