Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Commit

Permalink
fix: Fix memory leak in parse_object function
Browse files Browse the repository at this point in the history
  • Loading branch information
Antares0982 committed Mar 30, 2024
1 parent 0ef7e6c commit 8079a44
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/pycJSON_decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ static cJSON_bool parse_object(PyObject **item, parse_buffer *const input_buffer
buffer_skip_whitespace(input_buffer);
PyDict_SetItem(*item, keyBuffer, valueBuffer);
Py_DECREF(valueBuffer);
Py_DECREF(keyBuffer);
} while (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ','));

if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '}')) {
Expand Down

0 comments on commit 8079a44

Please sign in to comment.