[demux/split] memory leak
authorParichay Kapoor <pk.kapoor@samsung.com>
Tue, 5 Mar 2019 11:04:25 +0000 (20:04 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 6 Mar 2019 03:43:40 +0000 (12:43 +0900)
remove memory corresponding to get_property

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
gst/nnstreamer/tensor_demux/gsttensordemux.c
gst/nnstreamer/tensor_split/gsttensorsplit.c

index 30d47b2..6611b10 100644 (file)
@@ -581,8 +581,8 @@ gst_tensor_demux_get_property (GObject * object, guint prop_id,
       g_ptr_array_add (arr, NULL);
       strings = (gchar **) g_ptr_array_free (arr, FALSE);
       p = g_strjoinv (",", strings);
-      g_free (strings);
-      g_value_set_string (value, p);
+      g_strfreev (strings);
+      g_value_take_string (value, p);
       break;
     }
     default:
index 3ae8b78..57d2f83 100644 (file)
@@ -624,8 +624,8 @@ gst_tensor_split_get_property (GObject * object, guint prop_id,
       g_ptr_array_add (arr, NULL);
       strings = (gchar **) g_ptr_array_free (arr, FALSE);
       p = g_strjoinv (",", strings);
-      g_free (strings);
-      g_value_set_string (value, p);
+      g_strfreev (strings);
+      g_value_take_string (value, p);
       break;
     }
     case PROP_TENSORSEG:
@@ -644,7 +644,7 @@ gst_tensor_split_get_property (GObject * object, guint prop_id,
         g_ptr_array_add (arr, NULL);
         strings = (gchar **) g_ptr_array_free (arr, FALSE);
         p = g_strjoinv (":", strings);
-        g_free (strings);
+        g_strfreev (strings);
         if (i > 0) {
           /** if i = 1, this is previous p.
             * otherwise, it's previous g_strjoin result */
@@ -657,7 +657,7 @@ gst_tensor_split_get_property (GObject * object, guint prop_id,
           strv = p;
         }
       }
-      g_value_set_string (value, strv);
+      g_value_take_string (value, strv);
       break;
     }
     default: