From 60443469e61d74a0f3bd8ad6565d8c00bda8779f Mon Sep 17 00:00:00 2001 From: himanshu Date: Thu, 13 Feb 2020 18:36:32 +0530 Subject: [PATCH] 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 --- src/bluetooth-gatt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.7.4