From: Lennart Poettering Date: Fri, 23 Nov 2018 16:19:24 +0000 (+0100) Subject: show-status: use free_and_replace() where we can X-Git-Tag: v240~205^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ccfc08d4bcac9f3108cbfaeef8b9fad855d5961c;p=thirdparty%2Fsystemd.git show-status: use free_and_replace() where we can --- diff --git a/src/core/show-status.c b/src/core/show-status.c index e8ac004903e..f748a820846 100644 --- a/src/core/show-status.c +++ b/src/core/show-status.c @@ -73,10 +73,8 @@ int status_vprintf(const char *status, ShowStatusFlags flags, const char *format emax = 3; e = ellipsize(s, emax, 50); - if (e) { - free(s); - s = e; - } + if (e) + free_and_replace(s, e); } if (prev_ephemeral)