From: Tomi Ollila Date: Fri, 10 Jun 2016 11:13:26 +0000 (+0300) Subject: Re: [PATCH] lib: fix memory leak of field processor objects X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2414e288faa0986f30d7b9942d9670d66ffbe3fe;p=notmuch-archives.git Re: [PATCH] lib: fix memory leak of field processor objects --- diff --git a/05/b5f869282da75dd94114172d5b84b13d2b848e b/05/b5f869282da75dd94114172d5b84b13d2b848e new file mode 100644 index 000000000..672d5df90 --- /dev/null +++ b/05/b5f869282da75dd94114172d5b84b13d2b848e @@ -0,0 +1,84 @@ +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 083686DE02B0 + for ; Fri, 10 Jun 2016 04:13:45 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.571 +X-Spam-Level: +X-Spam-Status: No, score=0.571 tagged_above=-999 required=5 tests=[AWL=-0.081, + SPF_NEUTRAL=0.652] 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 4cST341FF9gt for ; + Fri, 10 Jun 2016 04:13:37 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by arlo.cworth.org (Postfix) with ESMTP id D17716DE0222 + for ; Fri, 10 Jun 2016 04:13:36 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 9BE48100104; + Fri, 10 Jun 2016 14:13:26 +0300 (EEST) +From: Tomi Ollila +To: David Bremner , notmuch@notmuchmail.org +Subject: Re: [PATCH] lib: fix memory leak of field processor objects +In-Reply-To: <1465526268-9522-1-git-send-email-david@tethera.net> +References: <1465526268-9522-1-git-send-email-david@tethera.net> +User-Agent: Notmuch/0.22+32~gd4854c5 (http://notmuchmail.org) Emacs/24.5.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +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 11:13:45 -0000 + +On Fri, Jun 10 2016, David Bremner wrote: + +> 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 +> + + +... ok, it was this I marked trivial and not the one I wrote in +id:m2r3c5ti1c.fsf@guru.guru-group.fi (the same thought about triviality may +apply, though) + + +> return status; +> } +> +> -- +> 2.8.1