From e282f51f57153f8f25c34819dfab28586db62156 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 12 Feb 2018 14:27:49 +0900 Subject: [PATCH] core/namespace: use free_and_replace() --- src/core/namespace.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/namespace.c b/src/core/namespace.c index 058b691a4a..5dd2cc7c3a 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; } -- 2.25.1