From ccfc08d4bcac9f3108cbfaeef8b9fad855d5961c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 23 Nov 2018 17:19:24 +0100 Subject: [PATCH] show-status: use free_and_replace() where we can --- src/core/show-status.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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) -- 2.47.3