From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 02nQFptBzWB6NwEAgWs5BA (envelope-from ) for ; Sat, 19 Jun 2021 03:00:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 8LLDEZtBzWCWGgAA1q6Kng (envelope-from ) for ; Sat, 19 Jun 2021 01:00:11 +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 CC6BF19A2B for ; Sat, 19 Jun 2021 03:00:10 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 50C282B275; Fri, 18 Jun 2021 21:00:02 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 52B8F2B1CD for ; Fri, 18 Jun 2021 20:59:58 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 2AC865FD25; Fri, 18 Jun 2021 20:59:58 -0400 (EDT) Received: (nullmailer pid 2267232 invoked by uid 1000); Sat, 19 Jun 2021 00:59:57 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH 2/2] lib/config: fix memory leak Date: Fri, 18 Jun 2021 21:59:44 -0300 Message-Id: <20210619005944.2267177-2-david@tethera.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210619005944.2267177-1-david@tethera.net> References: <20210619005944.2267177-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: TDRJBPZBTU5YH4G76KKKWKV64EXSB2KW X-Message-ID-Hash: TDRJBPZBTU5YH4G76KKKWKV64EXSB2KW X-MailFrom: bremner@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=1624064410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=2O75mnK37wz73GLwvocUgwKWVjqhOVn8uNgyoUYMyrA=; b=TabDKePLpB6Iwps0NBtGDa8Ul3mgUnuUQ4K9cM9s56RnyHqFhrNgeVUJxoIxJu36g1XNfY dELIiqvLRbbXOs0afrkc2yKOLAE5AXyEfACwp2yUumS92EwmmHo+58uVMl8ZcdjMV16GS6 XDNBPISToWoRnYby/GNjLsqP0WOLRa1H31ZFCifEqYK0sftjs0TG1wtHF9+xK9rW3y6/ga 25v8uRSDDEVnwgQhCDRFYe2b2P/OKI/0VEXg1SVTxO6oM4Mbgc5MasbwBxWBNySck9oeyi oGXwO2AP55w4ScUz7GsvwZTBpFiG8hONmsN7R3MYB+T6UQIfatzp19P3iRi/Bg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624064410; a=rsa-sha256; cv=none; b=gsynXbszDAQjjWqjIXewYrKOfHi+Ya3kQ8UhM8MNuI0wO6DzxOaFp0nqnICaVumnC9GCWC LRZjJuG/BRNV1x0FG1GnsmnI9j+PK1xoJgRmgwwpZtwbGXnvuYPwaQhbZagNPE584KpzxQ 1jVHOxJkSoMa0Dor5WEbV11/lQH+l5aoh2NUAPs+pZEbTnTeU+M7PVtdd4VTzFqqY/kk4C GvrUQW7poTog1H63dCXyc/T2xcUefPMezqE6ESeLohA/iekQtF+hUvhe4sZCtNvLDPFxH9 1KLPXN28FAt7afY/Ij3wfioIgBo+u0wsw6MmkKMhrtdVcW2U/ULxvoA687ZXpQ== 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.00 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: CC6BF19A2B X-Spam-Score: -1.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: YVGAnpqmZZ68 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); } void -- 2.30.2