From: Daan De Meyer Date: Thu, 8 Aug 2024 12:14:53 +0000 (+0200) Subject: sd-json: Use goto finish instead of return X-Git-Tag: v257-rc1~705^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e3878ff657ed203e9048007789b22b0377ba8d03;p=thirdparty%2Fsystemd.git sd-json: Use goto finish instead of return sd_json_buildv() uses a "finish" goto label for cleanup so make sure we goto that label on failure instead of returning directly. --- diff --git a/src/libsystemd/sd-json/sd-json.c b/src/libsystemd/sd-json/sd-json.c index 98ffe4db548..835ba56bedf 100644 --- a/src/libsystemd/sd-json/sd-json.c +++ b/src/libsystemd/sd-json/sd-json.c @@ -4098,7 +4098,7 @@ _public_ int sd_json_buildv(sd_json_variant **ret, va_list ap) { SD_JSON_BUILD_PAIR("realtime", SD_JSON_BUILD_UNSIGNED(ts->realtime)), SD_JSON_BUILD_PAIR("monotonic", SD_JSON_BUILD_UNSIGNED(ts->monotonic))); if (r < 0) - return r; + goto finish; } else add = JSON_VARIANT_MAGIC_NULL; }