Fix the svace issue - NULL_AFTER_DEREF 12/90012/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 28 Sep 2016 04:56:37 +0000 (13:56 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 28 Sep 2016 04:56:37 +0000 (13:56 +0900)
Change-Id: I323e035fbd8add33304d6ea2b2298e817f477239
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-api/bt-gatt-client.c

index 175d2be..cb66417 100644 (file)
@@ -281,8 +281,7 @@ BT_EXPORT_API int bluetooth_gatt_get_service_property(const char *service_handle
                                                __get_string_array_from_gptr_array(gp_array);
                        }
                        g_ptr_array_free(gp_array, TRUE);
-                       if (char_iter)
-                               g_variant_iter_free(char_iter);
+                       g_variant_iter_free(char_iter);
                } else if (!g_strcmp0(key, "Characteristics")) {
                        g_variant_get(value, "ao", &char_iter);
                        gp_array = g_ptr_array_new();
@@ -296,8 +295,7 @@ BT_EXPORT_API int bluetooth_gatt_get_service_property(const char *service_handle
                        }
                        BT_DBG("Characteristics count : %d",service->char_handle.count);
                        g_ptr_array_free(gp_array, TRUE);
-                       if (char_iter)
-                               g_variant_iter_free(char_iter);
+                       g_variant_iter_free(char_iter);
                }
        }