d/opengloves: Fix leaks of udev objects

This commit is contained in:
Jakob Bornecrantz 2022-09-29 00:14:18 +01:00 committed by Moses Turner
parent 034099211f
commit 1e639fc2f3

View file

@ -99,9 +99,14 @@ opengloves_get_serial_devices(uint16_t vid, uint16_t pid, struct opengloves_comm
parent_dev = udev_device_get_parent(parent_dev);
}
// Need to unref the raw device since we create that.
udev_device_unref(raw_dev);
}
// Both the enumerate and the udev struct needs to be unreferenced.
udev_enumerate_unref(tty_enumerate);
udev_unref(ud);
return dev_count;
}