[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-readline] history cleanup question
From: |
Jalil Karimov <address@hidden> |
Subject: |
[Bug-readline] history cleanup question |
Date: |
Sat, 28 Jan 2012 17:26:03 +0000 (GMT) |
User-agent: |
Alpine 2.00 (DEB 1167 2008-08-23) |
Hi,
I use readline in my application, and valgrind detected leaks even
if i use clear_history().
There's comment in this function:
/* This loses because we cannot free the data. */
So I tried with remove_history, such thing:
int i;
while ((i = history_length)) {
printf("%d\n", history_length);
HIST_ENTRY *rm = remove_history(i);
free_history_entry(rm);
free(rm);
}
And this causes an endless loop,
history_length doesn't get decremented, although it obviously does
in remove_history function after renumbering loop.
I'm confused, any feedback appreciated.
Jalil
- [Bug-readline] history cleanup question,
Jalil Karimov <address@hidden> <=