Skip to content

Commit

Permalink
Remove memory leak in yajl2_c's parse_basecoro
Browse files Browse the repository at this point in the history
This problem was initially reported in #28. Since memory leaks are still
checked manually (i.e., there is no automatic unit tests that check
memory consumption remains constant throughout an ijson execution) this
leak was somehow missed until now.

The problem was *not* present in the 2.x series, and this Py_DECREF()
call got lost during the refactoring for version 3.

Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
  • Loading branch information
rtobar committed Apr 22, 2020
1 parent 716b286 commit 80da1dc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ijson/backends/yajl2_c/parse_basecoro.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ PyObject* parse_basecoro_send_impl(PyObject *self, PyObject *event, PyObject *va
Py_DECREF(last_path);
}
N_M1(PyList_Append(gen->path, new_path));
Py_DECREF(new_path);
}
else if (event == enames.start_map_ename) {
Py_INCREF(Py_None);
Expand Down

0 comments on commit 80da1dc

Please sign in to comment.