From: Yu Watanabe Date: Mon, 12 Feb 2018 05:27:49 +0000 (+0900) Subject: core/namespace: use free_and_replace() X-Git-Tag: v238~79^2~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e282f51f57153f8f25c34819dfab28586db62156;p=thirdparty%2Fsystemd.git core/namespace: use free_and_replace() --- diff --git a/src/core/namespace.c b/src/core/namespace.c index 058b691a4a6..5dd2cc7c3ad 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -365,9 +365,7 @@ static int prefix_where_needed(MountEntry *m, unsigned n, const char *root_direc if (!s) return -ENOMEM; - free(m[i].path_malloc); - m[i].path_malloc = s; - + free_and_replace(m[i].path_malloc, s); m[i].has_prefix = true; }