This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author stefanholek
Recipients stefanholek
Date 2010-03-05.10:27:39
SpamBayes Score 0.008920067
Marked as misclassified No
Message-id <1267784862.24.0.455687340788.issue8065@psf.upfronthosting.co.za>
In-reply-to
Content
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,
History
Date User Action Args
2010-03-05 10:27:42stefanholeksetrecipients: + stefanholek
2010-03-05 10:27:42stefanholeksetmessageid: <1267784862.24.0.455687340788.issue8065@psf.upfronthosting.co.za>
2010-03-05 10:27:40stefanholeklinkissue8065 messages
2010-03-05 10:27:39stefanholekcreate