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 mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to