From: Mike Yuan Date: Fri, 4 Jul 2025 15:05:38 +0000 (+0200) Subject: core/mount: remove one more unused temporary variable X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a8fe8e83447a39831a23d82a82614fc19f2b9b46;p=thirdparty%2Fsystemd.git core/mount: remove one more unused temporary variable Similar to 3cea9c403c6d5ff0edb2b8fc99884f2243b1456e, but for mount_get_what_escaped(). --- diff --git a/src/core/mount.c b/src/core/mount.c index 801d2195b32..edbf7d201ca 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -2415,7 +2415,6 @@ char* mount_get_where_escaped(const Mount *m) { } char* mount_get_what_escaped(const Mount *m) { - _cleanup_free_ char *escaped = NULL; const char *s = NULL; assert(m); @@ -2424,14 +2423,10 @@ char* mount_get_what_escaped(const Mount *m) { s = m->parameters_proc_self_mountinfo.what; else if (m->from_fragment && m->parameters_fragment.what) s = m->parameters_fragment.what; + if (!s) + return strdup(""); - if (s) { - escaped = utf8_escape_invalid(s); - if (!escaped) - return NULL; - } - - return escaped ? TAKE_PTR(escaped) : strdup(""); + return utf8_escape_invalid(s); } char* mount_get_options_escaped(const Mount *m) {