summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/test/test-libudev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/test-libudev.c b/src/test/test-libudev.c
index 6bc77cf899..34c49b969a 100644
--- a/src/test/test-libudev.c
+++ b/src/test/test-libudev.c
@@ -341,8 +341,10 @@ static int test_enumerate(struct udev *udev, const char *subsystem) {
return -1;
udev_enumerate_add_match_subsystem(udev_enumerate,"block");
r = udev_enumerate_add_match_is_initialized(udev_enumerate);
- if (r < 0)
+ if (r < 0) {
+ udev_enumerate_unref(udev_enumerate);
return r;
+ }
udev_enumerate_scan_devices(udev_enumerate);
test_enumerate_print_list(udev_enumerate);
udev_enumerate_unref(udev_enumerate);