[systemd-commits] src/test

Thomas H.P. Andersen phomes at kemper.freedesktop.org
Mon May 11 12:43:08 PDT 2015


 src/test/test-libudev.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 86ff9f117300e9fa35bc20bbd13a6671efa70e79
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date:   Mon May 11 21:41:31 2015 +0200

    test-libudev: fix leak in error case
    
    CID# 1297428

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);



More information about the systemd-commits mailing list