[Common] init after free
authorJaeyun Jung <jy1210.jung@samsung.com>
Tue, 14 Nov 2023 08:49:49 +0000 (17:49 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 15 Nov 2023 04:53:29 +0000 (13:53 +0900)
Set default value after releasing tensor information struct.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
gst/nnstreamer/nnstreamer_plugin_api_util_impl.c

index 75bc589..97c256a 100644 (file)
@@ -141,10 +141,10 @@ gst_tensor_info_free (GstTensorInfo * info)
 {
   g_return_if_fail (info != NULL);
 
-  if (info->name) {
-    g_free (info->name);
-    info->name = NULL;
-  }
+  g_free (info->name);
+
+  /* Init default */
+  gst_tensor_info_init (info);
 }
 
 /**
@@ -400,6 +400,9 @@ gst_tensors_info_free (GstTensorsInfo * info)
 
   if (info->extra)
     gst_tensors_info_extra_free (info);
+
+  /* Init default */
+  gst_tensors_info_init (info);
 }
 
 /**