Fix the Svace issues 86/55786/1 submit/tizen_mobile/20151229.084941 submit/tizen_tv/20151229.084937 submit/tizen_wearable/20151229.084934
authorTaejin Woo <tt.woo@samsung.com>
Tue, 29 Dec 2015 08:40:25 +0000 (17:40 +0900)
committerTaejin Woo <tt.woo@samsung.com>
Tue, 29 Dec 2015 08:41:14 +0000 (17:41 +0900)
WGID : 28, 6097

Change-Id: Ifb4ce690655230a922a11d2b99f3b7d901e91b5f
Signed-off-by: Taejin Woo <tt.woo@samsung.com>
src/gatt.c

index ff31efe..8ada2e1 100644 (file)
@@ -764,7 +764,7 @@ gboolean gatt_unregister_internet_protocol_service(struct btd_adapter *adapter)
        bt_uuid16_create(&uuid, GATT_IPSP_UUID);
 
        a = attribute_find(adapter, &uuid);
-       if (!a) {
+       if (!a && a->handle != NULL) {
                error("Attribute not found for handle 0x%04x", a->handle);
                return FALSE;
        }
@@ -1051,7 +1051,7 @@ struct btd_attribute *btd_gatt_add_char(const bt_uuid_t *uuid,
 fail:
 #ifdef __TIZEN_PATCH__
        /* Fix : RESOURCE_LEAK */
-       if (char_decl->path)
+       if (char_decl != NULL && char_decl->path != NULL)
                g_free(char_decl->path);
        if (char_decl)
                free(char_decl);