From 8091cd90a5bdbd60acd973d029d0dc6ce60bc149 Mon Sep 17 00:00:00 2001 From: Nathaniel van Diepen Date: Wed, 2 Oct 2024 21:03:03 -0600 Subject: [PATCH] Code review feedback --- shared/liboxide/udev.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shared/liboxide/udev.cpp b/shared/liboxide/udev.cpp index 7c22d9db..62792408 100644 --- a/shared/liboxide/udev.cpp +++ b/shared/liboxide/udev.cpp @@ -41,11 +41,11 @@ namespace Oxide { } void UDev::subsystem(const QString& subsystem, std::function callback){ - deviceType(subsystem, NULL, callback); + deviceType(subsystem, "", callback); } void UDev::subsystem(const QString& subsystem, std::function callback){ - deviceType(subsystem, NULL, callback); + deviceType(subsystem, "", callback); } void UDev::deviceType(const QString& subsystem, const QString& deviceType, std::function callback){ @@ -144,10 +144,12 @@ namespace Oxide { } if(udev_enumerate_add_match_subsystem(udevEnumeration, subsystem.toUtf8().constData()) < 0){ O_WARNING("Failed to add subsystem"); + udev_enumerate_unref(udevEnumeration); return deviceList; } if(udev_enumerate_scan_devices(udevEnumeration) < 0){ O_WARNING("Failed to scan devices"); + udev_enumerate_unref(udevEnumeration); return deviceList; } struct udev_list_entry* udevDeviceList = udev_enumerate_get_list_entry(udevEnumeration);