projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0a51b45
)
json: fix minor memory leak on error path
author
Lennart Poettering
<lennart@poettering.net>
Mon, 20 May 2019 14:15:40 +0000
(16:15 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 20 May 2019 16:12:48 +0000
(18:12 +0200)
src/shared/json.c
patch
|
blob
|
history
diff --git
a/src/shared/json.c
b/src/shared/json.c
index 073f800b3464301eae6595549b71a3e8ab2cedc3..782d80af16aac0a2d77e591bd872b95e445340e2 100644
(file)
--- a/
src/shared/json.c
+++ b/
src/shared/json.c
@@
-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)
;
}
}