]> git.ipfire.org Git - thirdparty/systemd.git/commit
shared/json: fix memory leak on failed normalization
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 9 May 2022 12:28:36 +0000 (14:28 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 10 May 2022 10:58:49 +0000 (12:58 +0200)
commit7e4be6a5845f983a299932d4ccb2c4349cf8dd52
tree99fbbd919bc862159f1b840b9a4c19b01b53312d
parentbac06497feda9eb8c485243f2e05a7f7c112616c
shared/json: fix memory leak on failed normalization

We need to increase the counter immediately after taking the ref,
otherwise we may not unref it properly if we fail before incrementing.
src/shared/json.c
test/fuzz/fuzz-json/leak-normalize-fail [new file with mode: 0644]