Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id F1407431FB6 for ; Fri, 15 Apr 2011 08:15:44 -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 20Gz1Es77-z5 for ; Fri, 15 Apr 2011 08:15:44 -0700 (PDT) X-Greylist: delayed 1899 seconds by postgrey-1.32 at olra; Fri, 15 Apr 2011 08:15:44 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 30F11431FB5 for ; Fri, 15 Apr 2011 08:15:43 -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 p3FEi073098097 for ; Fri, 15 Apr 2011 16:44:02 +0200 (CEST) (envelope-from anton@khirnov.net) Received: by zohar.localdomain (Postfix, from userid 1000) id 9D6917F7D8; Fri, 15 Apr 2011 16:44:00 +0200 (CEST) From: Anton Khirnov To: notmuch@notmuchmail.org Subject: [PATCH] lib/message-file: plug three memleaks. Date: Fri, 15 Apr 2011 16:43:58 +0200 Message-Id: <1302878638-17634-1-git-send-email-anton@khirnov.net> X-Mailer: git-send-email 1.7.4.1 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: Fri, 15 Apr 2011 15:15:45 -0000 --- 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