From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yMY6DhXQ1WCukgAAgWs5BA (envelope-from ) for ; Fri, 25 Jun 2021 14:46:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id aGXTCRXQ1WApFAAAbx9fmQ (envelope-from ) for ; Fri, 25 Jun 2021 12:46:13 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9EBBC1D0CF for ; Fri, 25 Jun 2021 14:46:12 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 430E6290B4; Fri, 25 Jun 2021 08:46:10 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id E44E7290B4 for ; Fri, 25 Jun 2021 08:46:06 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id DA1355FD21; Fri, 25 Jun 2021 08:46:06 -0400 (EDT) Received: (nullmailer pid 4072435 invoked by uid 1000); Fri, 25 Jun 2021 12:46:05 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: Re: [PATCH 2/2] lib/config: fix memory leak In-Reply-To: <20210619005944.2267177-2-david@tethera.net> References: <20210619005944.2267177-1-david@tethera.net> <20210619005944.2267177-2-david@tethera.net> Date: Fri, 25 Jun 2021 09:46:05 -0300 Message-ID: <87lf6yi036.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: YBQ7EQ4GKQR2YPSAU5MZTSZEZMADNG3A X-Message-ID-Hash: YBQ7EQ4GKQR2YPSAU5MZTSZEZMADNG3A X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624625172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=iqkPk74VQ7DkGp2olC0PzNZYRQafIyJ6wOcGwun2cgw=; b=C98ULxctFCqNcXkRPQB/8TtE7aBO/3M/C76c2RDEiCMXiv5AO/lIpIXbwuOXSkSo/Qf1+a 1INS/KLA7LiDM8+r65jAjtJyeWTN5S6tEwQdGsaZonSzGcyWYaDso8clzkV5Dc8yAgkCL7 keIxzfAUQiRtmhas5fV/znbpFPD9Bmeaz+VlGyFSU8dzIuAPZo985E3FkQ/a/5jhx+HFK6 hQIH2E2DU4r1H4CZg6tJHs+Dy2EymLEDUc7tsBgf3cfBJlyrLEB+ssMls1mq9L0Z4ydne4 UkTaSklzLoh0iXNS06LIFO2dOPoOhOemcyifEQZrs3RmfIoJRtYjiwlJTjmGTw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624625172; a=rsa-sha256; cv=none; b=K/fRRHoQce+73ad6he/3RWEwZPNzIPRP1w4ah6y57WLmaTqx2U+6FrRaRCTVeKQGMdrZn6 8hIXTs3mzIa96f4zxczMrSO2cF76WpCMUby0hAO3CIRyXWVNu938k8Kz/5+1VK+UmpbNUA H+UkryJhjy9Fisbgf7pfC/G6mgeQo+rVdYga+oACmHweIJFOr7HI9BZG2z4Pfmi6w+5Lis Y3TgpmeSZoTpqi0QOMfGPT9lLm6290bOJxMqkN6rMqwzdyKV4QPRUTjBgjBqRyz0ibDWhg lllExRciva5NctQ36pWaxbYI3EUfBBWpp1u9xmVa6OfzOk9nAkvSwRKGlN1jFA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.99 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 9EBBC1D0CF X-Spam-Score: -1.99 X-Migadu-Scanner: scn1.migadu.com X-TUID: 0/zdmxzaabag David Bremner writes: > This commit fixes a small memory leak (per iterator restart) by > actually using the talloc context intended to be blown away on > restart. > --- > lib/config.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/config.cc b/lib/config.cc > index 0ec66372..368ed669 100644 > --- a/lib/config.cc > +++ b/lib/config.cc > @@ -318,7 +318,7 @@ notmuch_config_values_valid (notmuch_config_values_t *values) > const char * > notmuch_config_values_get (notmuch_config_values_t *values) > { > - return talloc_strndup (values, values->iterator, values->tok_len); > + return talloc_strndup (values->children, values->iterator, values->tok_len); > } applied to release and master d