]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
chase-symlinks: Fix memory leak
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 13 Mar 2023 16:07:50 +0000 (17:07 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 14 Mar 2023 08:56:59 +0000 (09:56 +0100)
src/basic/chase-symlinks.c

index f134d36925392e3c36e5efb73d283045185b854d..bf90ba23cc5031f135cf4b90090d21e9194f9a93 100644 (file)
@@ -522,7 +522,9 @@ int chase_symlinks(
                 return r;
 
         if (ret_path) {
-                char *q = path_join(empty_to_root(root), p);
+                _cleanup_free_ char *q = NULL;
+
+                q = path_join(empty_to_root(root), p);
                 if (!q)
                         return -ENOMEM;