1
0
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:
Krzysztof Gabis 2017-09-04 19:56:17 +01:00
parent e410fc7c33
commit d485b068c7

View File

@ -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;
}