Fix coverity issue: Incorrect deallocator used 68/224868/1
authorhimanshu <h.himanshu@samsung.com>
Thu, 13 Feb 2020 13:06:32 +0000 (18:36 +0530)
committerhimanshu <h.himanshu@samsung.com>
Thu, 13 Feb 2020 13:06:32 +0000 (18:36 +0530)
The client_s structure is allocated with
g_malloc0 therefore it must be freed with
g_free.

Change-Id: I12565ab60228c2828c3b9effcfc7c7c8694d2c64
Signed-off-by: himanshu <h.himanshu@samsung.com>
src/bluetooth-gatt.c

index e94df0a..e104286 100644 (file)
@@ -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;