diff --git a/src/hardware/libkybluetooth.c b/src/hardware/libkybluetooth.c index 2aaff9e..fceca33 100644 --- a/src/hardware/libkybluetooth.c +++ b/src/hardware/libkybluetooth.c @@ -672,7 +672,7 @@ char** kdk_bluetooth_get_device_name(int id) if (!tmp) goto err_out; con_name = tmp; - con_name[num] = (char *)calloc(1, sizeof(result)); + con_name[num] = (char *)calloc(1, strlen(result) + 1); if (!con_name[num]) { free(tmp);