tmpfiles: use free_and_replace() where appropriate

This commit is contained in:
Lennart Poettering 2018-10-25 13:57:32 +02:00
parent 7ab7529d45
commit 81fa4479f8
1 changed files with 2 additions and 4 deletions

View File

@ -2471,8 +2471,7 @@ static int patch_var_run(const char *fname, unsigned line, char **path) {
log_notice("[%s:%u] Line references path below legacy directory /var/run/, updating %s → %s; please update the tmpfiles.d/ drop-in file accordingly.", fname, line, *path, n);
free(*path);
*path = n;
free_and_replace(*path, n);
return 0;
}
@ -2709,8 +2708,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer, bool
if (!p)
return log_oom();
free(i.path);
i.path = p;
free_and_replace(i.path, p);
}
if (!isempty(user) && !streq(user, "-")) {