Fix Coverity issues(Dereference before null check) 87/318687/1 accepted/tizen_unified_x_asan accepted/tizen/unified/20250123.054012 accepted/tizen/unified/x/20250123.071359 accepted/tizen/unified/x/asan/20250211.003613
authorGilbok Lee <gilbok.lee@samsung.com>
Wed, 22 Jan 2025 07:00:35 +0000 (16:00 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Wed, 22 Jan 2025 07:00:35 +0000 (16:00 +0900)
- Remove unnecessary NULL checks

[Version] 0.4.5
[Issue Type] Fix Coverity issue

Change-Id: I62b101775292eb13ad7244ca1e940f524ac37fa8

packaging/libmm-wfd.spec
src/mm_wfd_sink_priv.c

index cc71a08dcda343c4e44301bdd4b25d49541a0671..d908756f774dd123c28a94f4aa0396f24a3c8aa2 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-wfd
 Summary:    Multimedia Framework Wifi-Display Library
-Version:    0.4.4
+Version:    0.4.5
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index 8a618b3552e9677d9255729d979881d5e52c1577..907e91a8538c0f3954af8436cea6e2fabb9281fb 100644 (file)
@@ -3087,7 +3087,7 @@ CREATE_ERROR:
 
        /* release element which are not added to bin */
        for (i = 1; i < WFD_SINK_M_NUM; i++) {  /* NOTE : skip pipeline */
-               if (mainbin != NULL && mainbin[i].gst) {
+               if (mainbin[i].gst) {
                        GstObject *parent = NULL;
                        parent = gst_element_get_parent(mainbin[i].gst);
 
@@ -3102,7 +3102,7 @@ CREATE_ERROR:
        }
 
        /* release mainbin with it's childs */
-       if (mainbin != NULL && mainbin[WFD_SINK_M_PIPE].gst) {
+       if (mainbin[WFD_SINK_M_PIPE].gst) {
                gst_object_unref(GST_OBJECT(mainbin[WFD_SINK_M_PIPE].gst));
                mainbin[WFD_SINK_M_PIPE].gst = NULL;
        }
@@ -3536,7 +3536,7 @@ CREATE_ERROR:
 
        /* release element which are not added to bin */
        for (i = 1; i < WFD_SINK_A_D_NUM; i++) {        /* NOTE : skip bin */
-               if (a_decodebin != NULL && a_decodebin[i].gst) {
+               if (a_decodebin[i].gst) {
                        GstObject *parent = NULL;
                        parent = gst_element_get_parent(a_decodebin[i].gst);
 
@@ -3551,7 +3551,7 @@ CREATE_ERROR:
        }
 
        /* release audio decodebin with it's childs */
-       if (a_decodebin != NULL && a_decodebin[WFD_SINK_A_D_BIN].gst) {
+       if (a_decodebin[WFD_SINK_A_D_BIN].gst) {
                gst_object_unref(GST_OBJECT(a_decodebin[WFD_SINK_A_D_BIN].gst));
                a_decodebin[WFD_SINK_A_D_BIN].gst = NULL;
        }
@@ -3774,7 +3774,7 @@ CREATE_ERROR:
 
        /* release element which are not added to bin */
        for (i = 1; i < WFD_SINK_A_S_NUM; i++) {        /* NOTE : skip bin */
-               if (a_sinkbin != NULL && a_sinkbin[i].gst) {
+               if (a_sinkbin[i].gst) {
                        GstObject *parent = NULL;
                        parent = gst_element_get_parent(a_sinkbin[i].gst);
 
@@ -3789,7 +3789,7 @@ CREATE_ERROR:
        }
 
        /* release audio sinkbin with it's childs */
-       if (a_sinkbin != NULL && a_sinkbin[WFD_SINK_A_S_BIN].gst) {
+       if (a_sinkbin[WFD_SINK_A_S_BIN].gst) {
                gst_object_unref(GST_OBJECT(a_sinkbin[WFD_SINK_A_S_BIN].gst));
                a_sinkbin[WFD_SINK_A_S_BIN].gst = NULL;
        }
@@ -4304,7 +4304,7 @@ CREATE_ERROR:
 
        /* release element which are not added to bin */
        for (i = 1; i < WFD_SINK_V_D_NUM; i++) {        /* NOTE : skip bin */
-               if (v_decodebin != NULL && v_decodebin[i].gst) {
+               if (v_decodebin[i].gst) {
                        GstObject *parent = NULL;
                        parent = gst_element_get_parent(v_decodebin[i].gst);
 
@@ -4319,7 +4319,7 @@ CREATE_ERROR:
        }
 
        /* release video decodebin with it's childs */
-       if (v_decodebin != NULL && v_decodebin[WFD_SINK_V_D_BIN].gst) {
+       if (v_decodebin[WFD_SINK_V_D_BIN].gst) {
                gst_object_unref(GST_OBJECT(v_decodebin[WFD_SINK_V_D_BIN].gst));
                v_decodebin[WFD_SINK_V_D_BIN].gst = NULL;
        }
@@ -4552,7 +4552,7 @@ CREATE_ERROR:
 
        /* release element which are not added to bin */
        for (i = 1; i < WFD_SINK_V_S_NUM; i++) {        /* NOTE : skip bin */
-               if (v_sinkbin != NULL && v_sinkbin[i].gst) {
+               if (v_sinkbin[i].gst) {
                        GstObject *parent = NULL;
                        parent = gst_element_get_parent(v_sinkbin[i].gst);
 
@@ -4567,7 +4567,7 @@ CREATE_ERROR:
        }
 
        /* release video sinkbin with it's childs */
-       if (v_sinkbin != NULL && v_sinkbin[WFD_SINK_V_S_BIN].gst) {
+       if (v_sinkbin[WFD_SINK_V_S_BIN].gst) {
                gst_object_unref(GST_OBJECT(v_sinkbin[WFD_SINK_V_S_BIN].gst));
                v_sinkbin[WFD_SINK_V_S_BIN].gst = NULL;
        }