[2727] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

Re: [PATCH] Don't leak partial history entries when replacing them

daemon@ATHENA.MIT.EDU (Nelson Elhage)
Mon Oct 25 12:24:49 2010

From: Nelson Elhage <nelhage@MIT.EDU>
To: David Benjamin <davidben@mit.edu>, barnowl-dev@mit.edu
In-Reply-To: <1287883227-20894-1-git-send-email-davidben@mit.edu>
Date: Mon, 25 Oct 2010 12:24:45 -0400

These all look good, assuming they're tested.

- Nelson

On Sat, 23 Oct 2010 21:20:27 -0400, David Benjamin <davidben@MIT.EDU> wrote:
> We're removing pointers from the history without freeing them.
> ---
>  history.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/history.c b/history.c
> index 34af972..9d45e01 100644
> --- a/history.c
> +++ b/history.c
> @@ -52,6 +52,7 @@ void owl_history_store(owl_history *h, const char *line)
>  
>    /* if partial is set, remove the first entry first */
>    if (h->partial) {
> +    owl_free(owl_list_get_element(&(h->hist), 0));
>      owl_list_remove_element(&(h->hist), 0);
>    }
>  
> -- 
> 1.7.3.1.g716de
> 
> 

home help back first fref pref prev next nref lref last post