json: fix minor memory leak on error path

This commit is contained in:
Lennart Poettering 2019-05-20 16:15:40 +02:00
parent 0a51b45ce4
commit 6980b04fb6
1 changed files with 2 additions and 2 deletions

View File

@ -2296,9 +2296,9 @@ static int json_parse_internal(
column = &column_buffer;
for (;;) {
_cleanup_(json_variant_unrefp) JsonVariant *add = NULL;
_cleanup_free_ char *string = NULL;
unsigned line_token, column_token;
JsonVariant *add = NULL;
JsonStack *current;
JsonValue value;
int token;
@ -2591,7 +2591,7 @@ static int json_parse_internal(
goto finish;
}
current->elements[current->n_elements++] = add;
current->elements[current->n_elements++] = TAKE_PTR(add);
}
}