]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
load-fragment: use free_and_replace() 9142/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 31 May 2018 04:27:06 +0000 (13:27 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 31 May 2018 04:27:06 +0000 (13:27 +0900)
src/core/load-fragment.c

index bb258c4d299161f0cae4e2c115d2e36b2e7f9501..f16b0d182ba10e23eaa04150ac1373a3d46a4dfb 100644 (file)
@@ -4594,8 +4594,7 @@ static int open_follow(char **filename, FILE **_f, Set *names, char **_final) {
                 if (r < 0)
                         return r;
 
-                free(*filename);
-                *filename = target;
+                free_and_replace(*filename, target);
         }
 
         f = fdopen(fd, "re");