Skip to content

Commit

Permalink
Fix memory leak in parson's parse_object_value()
Browse files Browse the repository at this point in the history
  • Loading branch information
jepio committed Nov 13, 2024
1 parent fd2e149 commit 5b1651e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/common/parson/parson.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,9 @@ static JSON_Value * parse_object_value(const char **string, size_t nesting) {
new_key = get_quoted_string(string, &key_len);
/* We do not support key names with embedded \0 chars */
if (new_key == NULL || key_len != strlen(new_key)) {
if (new_key) {
parson_free(new_key);
}
json_value_free(output_value);
return NULL;
}
Expand Down

0 comments on commit 5b1651e

Please sign in to comment.