From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id D9529429E22 for ; Sun, 8 May 2011 23:46:50 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oH48o1UYLhVg for ; Sun, 8 May 2011 23:46:50 -0700 (PDT) Received: from smtp1.kolej.mff.cuni.cz (smtp1.kolej.mff.cuni.cz [78.128.192.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id C0ACB429E20 for ; Sun, 8 May 2011 23:46:49 -0700 (PDT) X-Envelope-From: anton@khirnov.net Received: from zohar.localdomain (zohar.kolej.mff.cuni.cz [78.128.198.199]) by smtp1.kolej.mff.cuni.cz (8.14.4/8.14.4) with ESMTP id p496kjDl074702 for ; Mon, 9 May 2011 08:46:46 +0200 (CEST) (envelope-from anton@khirnov.net) Received: by zohar.localdomain (Postfix, from userid 1000) id 2B6AD7F508; Mon, 9 May 2011 08:46:45 +0200 (CEST) From: Anton Khirnov Subject: Re: [PATCH] lib/message-file: plug three memleaks. To: notmuch@notmuchmail.org In-Reply-To: <1302878638-17634-1-git-send-email-anton@khirnov.net> References: <1302878638-17634-1-git-send-email-anton@khirnov.net> Date: Mon, 09 May 2011 08:46:44 +0200 Message-Id: <20110509064645.2B6AD7F508@zohar.localdomain> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 06:46:51 -0000 On Fri, 15 Apr 2011 16:43:58 +0200, Anton Khirnov 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@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch ping -- Anton Khirnov