From e511e3348af0a58369b710e505fbd774e63d273f Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Wed, 28 Sep 2016 13:56:37 +0900 Subject: [PATCH] Fix the svace issue - NULL_AFTER_DEREF Change-Id: I323e035fbd8add33304d6ea2b2298e817f477239 Signed-off-by: DoHyun Pyun --- bt-api/bt-gatt-client.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bt-api/bt-gatt-client.c b/bt-api/bt-gatt-client.c index 175d2be..cb66417 100644 --- a/bt-api/bt-gatt-client.c +++ b/bt-api/bt-gatt-client.c @@ -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); } } -- 2.7.4