]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-chase-symlinks: fix coverity issue
authorLennart Poettering <lennart@poettering.net>
Wed, 31 Jul 2019 07:42:24 +0000 (09:42 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 31 Jul 2019 07:45:03 +0000 (09:45 +0200)
Fixes coverity issue 1403708

src/test/test-chase-symlinks.c

index 3fac6b6bc5bcdbbad6d3fafc3454c9eb7e3fe801..013b36e2a7a5e502892343046574dc9d2313855a 100644 (file)
@@ -1,8 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 #include <getopt.h>
 
-#include "log.h"
+#include "fd-util.h"
 #include "fs-util.h"
+#include "log.h"
 #include "main-func.h"
 
 static char *arg_root = NULL;
@@ -97,6 +98,9 @@ static int run(int argc, char **argv) {
                         log_error_errno(r, "failed: %m");
                 else
                         log_info("→ %s", p);
+
+                if (FLAGS_SET(arg_flags, CHASE_OPEN))
+                        safe_close(r);
         }
 
         return 0;