From 86ff9f117300e9fa35bc20bbd13a6671efa70e79 Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Mon, 11 May 2015 21:41:31 +0200 Subject: [PATCH] test-libudev: fix leak in error case CID# 1297428 --- src/test/test-libudev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/test-libudev.c b/src/test/test-libudev.c index 6bc77cf..34c49b9 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); -- 2.7.4