mirror of
https://github.com/systemd/systemd
synced 2024-10-15 04:24:19 +00:00
shared/json: fix another memleak in normalization
This commit is contained in:
parent
dbd27c6d28
commit
3b6ce05537
|
@ -4621,7 +4621,7 @@ int json_variant_sort(JsonVariant **v) {
|
|||
|
||||
int json_variant_normalize(JsonVariant **v) {
|
||||
_cleanup_free_ JsonVariant **a = NULL;
|
||||
JsonVariant *n = NULL;
|
||||
_cleanup_(json_variant_unrefp) JsonVariant *n = NULL;
|
||||
size_t i, m;
|
||||
int r;
|
||||
|
||||
|
@ -4669,7 +4669,7 @@ int json_variant_normalize(JsonVariant **v) {
|
|||
goto finish;
|
||||
}
|
||||
|
||||
JSON_VARIANT_REPLACE(*v, n);
|
||||
JSON_VARIANT_REPLACE(*v, TAKE_PTR(n));
|
||||
|
||||
r = 1;
|
||||
|
||||
|
|
1
test/fuzz/fuzz-json/leak-normalize-object
Normal file
1
test/fuzz/fuzz-json/leak-normalize-object
Normal file
|
@ -0,0 +1 @@
|
|||
[7,7,7,7,{"":7,"":7,"^t":7,"-":7},2777,7,7,7,3]
|
Loading…
Reference in a new issue