Commit 1f9c0941 authored by Peter Wu's avatar Peter Wu Committed by Richard Hughes

hidpp: fix memleak for each Feature

The name of each Logitech HID++ 2.0 Feature will now be freed.

https://bugs.freedesktop.org/show_bug.cgi?id=82659
parent 73927044
......@@ -1014,6 +1014,17 @@ out:
return ret;
}
/**
* hidpp_device_free_feature:
**/
static void
hidpp_device_free_feature (gpointer data)
{
HidppDeviceMap *map = data;
g_free (map->name);
g_free (map);
}
/**
* hidpp_device_init:
**/
......@@ -1024,7 +1035,7 @@ hidpp_device_init (HidppDevice *device)
device->priv = HIDPP_DEVICE_GET_PRIVATE (device);
device->priv->fd = -1;
device->priv->feature_index = g_ptr_array_new_with_free_func (g_free);
device->priv->feature_index = g_ptr_array_new_with_free_func (hidpp_device_free_feature);
device->priv->batt_status = HIDPP_DEVICE_BATT_STATUS_UNKNOWN;
device->priv->kind = HIDPP_DEVICE_KIND_UNKNOWN;
device->priv->lux = -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment