mirror of
https://github.com/kgabis/parson.git
synced 2025-01-14 06:12:54 +08:00
Fixes a memory leak (issue #82).
This commit is contained in:
parent
e410fc7c33
commit
d485b068c7
7
parson.c
7
parson.c
@ -669,8 +669,13 @@ static JSON_Value * parse_object_value(const char **string, size_t nesting) {
|
||||
}
|
||||
while (**string != '\0') {
|
||||
new_key = get_quoted_string(string);
|
||||
if (new_key == NULL) {
|
||||
json_value_free(output_value);
|
||||
return NULL;
|
||||
}
|
||||
SKIP_WHITESPACES(string);
|
||||
if (new_key == NULL || **string != ':') {
|
||||
if (**string != ':') {
|
||||
parson_free(new_key);
|
||||
json_value_free(output_value);
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user