From 9980fa459575208f3f5b45fddd1479044684d71b Mon Sep 17 00:00:00 2001 From: David Bremner Date: Fri, 10 Jun 2016 23:37:48 +2100 Subject: [PATCH] [PATCH] lib: fix memory leak of field processor objects --- 59/1430d1c1310c637fa083f75fb75f40577e803e | 72 +++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 59/1430d1c1310c637fa083f75fb75f40577e803e diff --git a/59/1430d1c1310c637fa083f75fb75f40577e803e b/59/1430d1c1310c637fa083f75fb75f40577e803e new file mode 100644 index 000000000..4a03eadc6 --- /dev/null +++ b/59/1430d1c1310c637fa083f75fb75f40577e803e @@ -0,0 +1,72 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 53CCA6DE0222 + for ; Thu, 9 Jun 2016 19:38:07 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.011 +X-Spam-Level: +X-Spam-Status: No, score=-0.011 tagged_above=-999 required=5 + tests=[AWL=-0.000, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] + autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id kaR8unsRkMWl for ; + Thu, 9 Jun 2016 19:37:59 -0700 (PDT) +Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) + by arlo.cworth.org (Postfix) with ESMTPS id 9B7156DE01C2 + for ; Thu, 9 Jun 2016 19:37:59 -0700 (PDT) +Received: from remotemail by fethera.tethera.net with local (Exim 4.84) + (envelope-from ) + id 1bBCKQ-00039l-3S; Thu, 09 Jun 2016 22:37:46 -0400 +Received: (nullmailer pid 9565 invoked by uid 1000); + Fri, 10 Jun 2016 02:37:55 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [PATCH] lib: fix memory leak of field processor objects +Date: Thu, 9 Jun 2016 23:37:48 -0300 +Message-Id: <1465526268-9522-1-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.8.1 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +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, 10 Jun 2016 02:38:07 -0000 + +The field processor objects need to be deallocated explicitly just like +the range processors (or a talloc destructor defined). +--- + lib/database.cc | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/lib/database.cc b/lib/database.cc +index 2b2d821..afafe88 100644 +--- a/lib/database.cc ++++ b/lib/database.cc +@@ -1107,6 +1107,13 @@ notmuch_database_close (notmuch_database_t *notmuch) + delete notmuch->last_mod_range_processor; + notmuch->last_mod_range_processor = NULL; + ++#if HAVE_XAPIAN_FIELD_PROCESSOR ++ delete notmuch->date_field_processor; ++ notmuch->date_field_processor = NULL; ++ delete notmuch->query_field_processor; ++ notmuch->query_field_processor = NULL; ++#endif ++ + return status; + } + +-- +2.8.1 + -- 2.26.2