utils: Fix get_device_file() retval

Possible use-after-free.
This commit is contained in:
Bastien Nocera
2021-01-21 15:50:16 +01:00
parent e3594b879c
commit fbb67da3a7

View File

@@ -13,7 +13,7 @@ char *
get_device_file (GUdevDevice *device)
{
if (!IS_TEST)
return g_udev_device_get_device_file (device);
return g_strdup (g_udev_device_get_device_file (device));
return g_build_filename (g_getenv ("UMOCKDEV_DIR"),
"iio-dev-data.bin",