packages/libs/libudev-zero/patches/0009-various-fix-memory-leaks.patch
Florian Eckert 0c66639a28 libudev-zero: backport latest changes to fix blocking on devices scan
This change added the latest upstream changes since version 1.0.0.

When using the smart plugin from collectd, there are problems with the
function udev_enumerate_scan_devices. This function is blocked and no
longer returns. Backporting the latest fixes from libudev-zero solves
the problem.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-03-16 19:46:41 -07:00

47 lines
1.1 KiB
Diff

From 7265d305c27dee05436a25dc60481ad62e022756 Mon Sep 17 00:00:00 2001
From: illiliti <illiliti@protonmail.com>
Date: Fri, 8 Oct 2021 08:53:04 +0300
Subject: [PATCH 09/15] various: fix memory leaks
Closes: #41
---
udev_device.c | 2 ++
udev_list.c | 3 +++
2 files changed, 5 insertions(+)
--- a/udev_device.c
+++ b/udev_device.c
@@ -546,12 +546,14 @@ struct udev_device *udev_device_new_from
}
if (!realpath(syspath, path)) {
+ free(subsystem);
return NULL;
}
udev_device = calloc(1, sizeof(*udev_device));
if (!udev_device) {
+ free(subsystem);
return NULL;
}
--- a/udev_list.c
+++ b/udev_list.c
@@ -78,6 +78,7 @@ struct udev_list_entry *udev_list_entry_
list_entry2->name = strdup(name);
if (!list_entry2->name) {
+ free(list_entry2);
return NULL;
}
@@ -85,6 +86,8 @@ struct udev_list_entry *udev_list_entry_
list_entry2->value = strdup(value);
if (!list_entry2->value) {
+ free(list_entry2->name);
+ free(list_entry2);
return NULL;
}
}