[gst-debugger] debugserver: fix a few memleaks



commit 1a430b58b1c238e8663b2e63397809436cc3dadb
Author: Marcin Kolny <marcin kolny gmail com>
Date:   Sun Aug 30 17:53:35 2015 +0200

    debugserver: fix a few memleaks

 src/debugserver/gstdebugserverlog.c      |    2 +-
 src/debugserver/gstdebugservertopology.c |    8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/debugserver/gstdebugserverlog.c b/src/debugserver/gstdebugserverlog.c
index 225d15e..13a5a9f 100644
--- a/src/debugserver/gstdebugserverlog.c
+++ b/src/debugserver/gstdebugserverlog.c
@@ -64,7 +64,7 @@ gint gst_debugserver_log_prepare_buffer (GstDebugCategory * category,
   log.level = (gint)level;
   log.category_name = (gchar*) gst_debug_category_get_name (category);
   log.file = (gchar*) file;
-  log.function = g_strdup (function);
+  log.function = (gchar*) function;
   log.line = line;
   log.object_path = "todo";
   log.message = (gchar*) gst_debug_message_get (message);
diff --git a/src/debugserver/gstdebugservertopology.c b/src/debugserver/gstdebugservertopology.c
index eb2fdf7..119601e 100644
--- a/src/debugserver/gstdebugservertopology.c
+++ b/src/debugserver/gstdebugservertopology.c
@@ -47,16 +47,16 @@ send_object (GstObject *object, Topology__Action action, GstDebugserverTcp * ser
   gchar buffer[1024];
   TopologyElement element_tp = TOPOLOGY_ELEMENT__INIT;
   TopologyPad pad_tp = TOPOLOGY_PAD__INIT;
-  TopologyTemplate template;
+  TopologyTemplate template = TOPOLOGY_TEMPLATE__INIT;
 
   info.info_type = GSTREAMER_INFO__INFO_TYPE__TOPOLOGY;
   topology.action = action;
 
   if (GST_IS_ELEMENT (object)) {
-    element_tp.type_name = g_strdup (g_type_name (G_OBJECT_TYPE (object)));
+    element_tp.type_name = (gchar*) g_type_name (G_OBJECT_TYPE (object));
     element_tp.path = gst_utils_get_object_path (object);
     element_tp.is_bin = GST_IS_BIN (object);
-    element_tp.factory_name = g_strdup (gst_plugin_feature_get_name (gst_element_get_factory 
(GST_ELEMENT_CAST (object))));
+    element_tp.factory_name = gst_plugin_feature_get_name (gst_element_get_factory (GST_ELEMENT_CAST 
(object)));
     topology.element = &element_tp;
     topology.type = TOPOLOGY__OBJECT_TYPE__ELEMENT;
   } else if (GST_IS_PAD (object)) {
@@ -79,6 +79,8 @@ send_object (GstObject *object, Topology__Action action, GstDebugserverTcp * ser
   assert(size <= 1024);
   gstreamer_info__pack (&info, (guint8*)buffer);
 
+  g_free (template.caps);
+
   gst_debugserver_tcp_send_packet (server, client, buffer, size);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]