From 44386b449b8435096cc17157263281981f1ec079 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 2 Nov 2018 03:24:57 +0900 Subject: [PATCH] network: improve readability of config_parse_ifalias() --- src/libsystemd-network/network-internal.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libsystemd-network/network-internal.c b/src/libsystemd-network/network-internal.c index 949798a1d3c..d2590d7c46e 100644 --- a/src/libsystemd-network/network-internal.c +++ b/src/libsystemd-network/network-internal.c @@ -255,11 +255,10 @@ int config_parse_ifalias(const char *unit, return 0; } - free(*s); - if (*n) - *s = TAKE_PTR(n); + if (isempty(n)) + *s = mfree(*s); else - *s = NULL; + free_and_replace(*s, n); return 0; }