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.
This commit is contained in:
Daan De Meyer
2024-08-14 14:18:40 +02:00
parent 32c9bf14ce
commit e3878ff657
+1 -1
View File
@@ -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;
}