From: Mike Yuan Date: Sun, 6 Apr 2025 22:26:57 +0000 (+0200) Subject: core/mount: remove unused temporary variable X-Git-Tag: v258-rc1~652^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cea9c403c6d5ff0edb2b8fc99884f2243b1456e;p=thirdparty%2Fsystemd.git core/mount: remove unused temporary variable --- diff --git a/src/core/mount.c b/src/core/mount.c index a831bac697f..c496375a212 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -2416,7 +2416,6 @@ char* mount_get_what_escaped(const Mount *m) { } char* mount_get_options_escaped(const Mount *m) { - _cleanup_free_ char *escaped = NULL; const char *s = NULL; assert(m); @@ -2425,14 +2424,10 @@ char* mount_get_options_escaped(const Mount *m) { s = m->parameters_proc_self_mountinfo.options; else if (m->from_fragment && m->parameters_fragment.options) s = m->parameters_fragment.options; + 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); } const char* mount_get_fstype(const Mount *m) {