projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
32c9bf1
)
sd-json: Use goto finish instead of return
author
Daan De Meyer
<daan.j.demeyer@gmail.com>
Thu, 8 Aug 2024 12:14:53 +0000
(14:14 +0200)
committer
Daan De Meyer
<daan.j.demeyer@gmail.com>
Wed, 14 Aug 2024 12:18:40 +0000
(14:18 +0200)
sd_json_buildv() uses a "finish" goto label for cleanup so make sure
we goto that label on failure instead of returning directly.
src/libsystemd/sd-json/sd-json.c
patch
|
blob
|
history
diff --git
a/src/libsystemd/sd-json/sd-json.c
b/src/libsystemd/sd-json/sd-json.c
index 98ffe4db5482b31bdb0c16aa01cb54b80e18e1cf..835ba56bedf0c9bfb0e71511b653573b07f32cd3 100644
(file)
--- 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;
}