From cb6a9390167622422b48e027053eac3971a6fbc5 Mon Sep 17 00:00:00 2001 From: HyoungjooAhn Date: Tue, 11 Dec 2018 13:05:53 +0900 Subject: [PATCH] [Filter] add condition to check input/output name check the existance of the value before free for input/output name properties Signed-off-by: HyoungjooAhn --- gst/tensor_filter/tensor_filter.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gst/tensor_filter/tensor_filter.c b/gst/tensor_filter/tensor_filter.c index 9b8a856..1f47a8a 100644 --- a/gst/tensor_filter/tensor_filter.c +++ b/gst/tensor_filter/tensor_filter.c @@ -554,8 +554,7 @@ gst_tensor_filter_set_property (GObject * object, guint prop_id, prop->input_meta.num_tensors = g_strv_length (str_names); for (i = 0; i < prop->input_meta.num_tensors; i++) { - if (strlen (prop->input_meta.info[i].name)) - g_free ((char *) prop->input_meta.info[i].name); + g_free ((char *) prop->input_meta.info[i].name); prop->input_meta.info[i].name = g_strdup (str_names[i]); g_assert (prop->input_meta.info[i].name && prop->input_meta.info[i].name[0] != '\0'); @@ -576,8 +575,7 @@ gst_tensor_filter_set_property (GObject * object, guint prop_id, prop->output_meta.num_tensors = g_strv_length (str_names); for (i = 0; i < prop->output_meta.num_tensors; i++) { - if (strlen (prop->output_meta.info[i].name)) - g_free ((char *) prop->output_meta.info[i].name); + g_free ((char *) prop->output_meta.info[i].name); prop->output_meta.info[i].name = g_strdup (str_names[i]); g_assert (prop->output_meta.info[i].name && prop->output_meta.info[i].name[0] != '\0'); -- 2.7.4