[PATCH] lib/message-file: plug three memleaks.

Anton Khirnov anton at khirnov.net
Sun May 8 23:46:44 PDT 2011


On Fri, 15 Apr 2011 16:43:58 +0200, Anton Khirnov <anton at khirnov.net> wrote:
> ---
>  lib/message-file.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/lib/message-file.c b/lib/message-file.c
> index 7722832..b7b3286 100644
> --- a/lib/message-file.c
> +++ b/lib/message-file.c
> @@ -341,12 +341,17 @@ notmuch_message_file_get_header (notmuch_message_file_t *message,
>  		strncpy(combined_header,header_sofar,hdrsofar);
>  		*(combined_header+hdrsofar) = ' ';
>  		strncpy(combined_header+hdrsofar+1,decoded_value,newhdr+1);
> +		free(decoded_value);
>  		g_hash_table_insert (message->headers, header, combined_header);
>  	    }
>  	} else {
>  	    if (header_sofar == NULL) {
>  		/* Only insert if we don't have a value for this header, yet. */
>  		g_hash_table_insert (message->headers, header, decoded_value);
> +	    } else {
> +		free(header);
> +		free(decoded_value);
> +		decoded_value = header_sofar;
>  	    }
>  	}
>  	/* if we found a match we can bail - unless of course we are
> -- 
> 1.7.4.1
> 
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

ping

--
Anton Khirnov


More information about the notmuch mailing list