From: himanshu Date: Thu, 13 Feb 2020 13:06:32 +0000 (+0530) Subject: Fix coverity issue: Incorrect deallocator used X-Git-Tag: submit/tizen/20200214.001348~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F68%2F224868%2F1;p=platform%2Fcore%2Fapi%2Fbluetooth.git Fix coverity issue: Incorrect deallocator used The client_s structure is allocated with g_malloc0 therefore it must be freed with g_free. Change-Id: I12565ab60228c2828c3b9effcfc7c7c8694d2c64 Signed-off-by: himanshu --- diff --git a/src/bluetooth-gatt.c b/src/bluetooth-gatt.c index e94df0a..e104286 100644 --- a/src/bluetooth-gatt.c +++ b/src/bluetooth-gatt.c @@ -3422,7 +3422,7 @@ int bt_gatt_client_create(const char *remote_address, bt_gatt_client_h *client) client_s->remote_address = g_strdup(remote_address); if (client_s->remote_address == NULL) { - free(client_s); + g_free(client_s); ret = BT_ERROR_OUT_OF_MEMORY; BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret); return ret;