Message100462
The history state must be freed, like so:
diff --git a/rl/readline.c b/rl/readline.c
index a676892..2394dca 100644
--- a/rl/readline.c
+++ b/rl/readline.c
@@ -576,9 +576,12 @@ static PyObject *
get_current_history_length(PyObject *self, PyObject *noarg)
{
HISTORY_STATE *hist_st;
+ PyObject *length;
hist_st = history_get_history_state();
- return PyInt_FromLong(hist_st ? (long) hist_st->length : (long) 0);
+ length = PyInt_FromLong(hist_st ? (long) hist_st->length : (long) 0);
+ free(hist_st);
+ return length;
}
PyDoc_STRVAR(doc_get_current_history_length, |
|
Date |
User |
Action |
Args |
2010-03-05 10:27:42 | stefanholek | set | recipients:
+ stefanholek |
2010-03-05 10:27:42 | stefanholek | set | messageid: <1267784862.24.0.455687340788.issue8065@psf.upfronthosting.co.za> |
2010-03-05 10:27:40 | stefanholek | link | issue8065 messages |
2010-03-05 10:27:39 | stefanholek | create | |
|