]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
env-file: use free_and_replace()
authorFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 24 May 2023 09:41:30 +0000 (11:41 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 24 May 2023 11:56:22 +0000 (13:56 +0200)
src/basic/env-file.c

index 7b3e209ddcac6aa34dcf2a24ba6ed84287789f98..58d7b3ec359d5a949be7652807980e248d1c3641 100644 (file)
@@ -330,8 +330,7 @@ static int parse_env_file_push(
 
                 if (streq(key, k)) {
                         va_end(aq);
-                        free(*v);
-                        *v = value;
+                        free_and_replace(*v, value);
 
                         return 1;
                 }