diff options
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rw-r--r-- | coverage/tracer.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index be3e7530..84be6db6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,6 +5,8 @@ Change history for Coverage.py Version 3.2b3
-------------
+- Fixed a memory leak in the C tracer that was introduced in 3.2b1.
+
- The table of contents in the HTML report is now sortable. Thanks,
`Chris Adams`_.
diff --git a/coverage/tracer.c b/coverage/tracer.c index 8c115708..2ecd187a 100644 --- a/coverage/tracer.c +++ b/coverage/tracer.c @@ -388,7 +388,9 @@ Tracer_trace(Tracer *self, PyFrameObject *frame, int what, PyObject *arg) }
else {
/* Tracing lines: key is simply this_line. */
- PyDict_SetItem(self->cur_file_data, MyInt_FromLong(frame->f_lineno), Py_None);
+ PyObject * this_line = MyInt_FromLong(frame->f_lineno);
+ PyDict_SetItem(self->cur_file_data, this_line, Py_None);
+ Py_DECREF(this_line);
}
}
self->last_line = frame->f_lineno;
|