From nobody Tue Sep 27 13:28:47 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4McL740X7Hz4d0n8; Tue, 27 Sep 2022 13:28:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4McL7373NZz3VXl; Tue, 27 Sep 2022 13:28:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664285328; 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; bh=HN/8QElmJlshavS03IZ6S8MS3YH9SKH99HQYKVeDL6I=; b=MYblRdy1M2aTl6jW3P3+i7VQ8sen3KQU3eaNa5FYe3b5ho93yzrYqrsxj5WJXpOYy3/Vxe V1iEAmIWdTpRkfBx4+Ciqa+tAYyaa1aUNp7WT8rye4GV50vXdFGpgl0kmRq7+Plp2v36zR bSV2eVh36Tarrcu3fNdqZBHIf2h7rfnM0DPkdzWBl3wEz63GhzuK2GiPEYo+baHir9nhE8 rP6RCcFGAjsFUv0Fbptn3tCUByh/mEfYrTGy8++R+AVYtShRbn85mTtUChtluTqnShapa9 TalAi0E+dNEHETZiBG7n5FMdSP4wkGyuBw2MDQpdIeG6uoByqAxnS9Yt97qUXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4McL736410z17f3; Tue, 27 Sep 2022 13:28:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28RDSlRN079334; Tue, 27 Sep 2022 13:28:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28RDSlfk079333; Tue, 27 Sep 2022 13:28:47 GMT (envelope-from git) Date: Tue, 27 Sep 2022 13:28:47 GMT Message-Id: <202209271328.28RDSlfk079333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 0044bd90f239 - main - pf: fix memory leak retrieving Ethernet rules List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0044bd90f2397dfad5f4bbd12c64be86e0b7eb4a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664285328; 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; bh=HN/8QElmJlshavS03IZ6S8MS3YH9SKH99HQYKVeDL6I=; b=yQDepbUhgRFV+yRrk/lRJweO9OJsZcIj7cuwXIZXAV2iVDCdnQnHUFTh8y32HYg1kIszqD KfrcInxbCHIE1umwFw9eCF/K/UC73JUlg9FKiaaUdBYD4ygvbFZ+COWyQDEH9mOIW/0xcK 8JWD9czea9Oyqs/VSAwQf7zENJ0XL8nTaT9RzQz5ZxsuEoRw0qc3WUZc0VhvmyRsH7B8Mc hH6E5zSwdZDO+Dk6LE+xBsNw3YlEnvLhSj91JjytIRz0QSuwlr/30WRFJ1SCNj7n6Gej4+ JrxLIpWHzsX0LzNMOrRBjw3rMnEIsdBA8CJoaDpUY3EyeY/uZKy2ZRRNZ7CeUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664285328; a=rsa-sha256; cv=none; b=tsVbjGVaVFZb6hk+gSFOmWQ3v9yfRIpscKQDF8lsmbYBHqx5MOnT+3XBTmBRX36cvy9RgH UzgU3W6Yqge307Ap4iUn0FsruFYPoTDb5vFrpPVOQ7NnPRINtsjFgPKTjzwzNQIDEh3Gev W1Rk8oQiOD/AqulAPTxaeT5X5zzp85jAZM4/H7cnb4BjO7W+iGRNC80tPMOL34T4XUd7Cz tYyWby2GWze74eeQqkgvl+7BgDROI148aCVYML51MOk+IwIjn4mrtvOU+H4/VQnfrKJx0P YaM2c/hYYLGUEuY60aMw84IBgRVkKc0cv5ZDi2yYqrGo9Ej6usxx704jrA3njg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0044bd90f2397dfad5f4bbd12c64be86e0b7eb4a commit 0044bd90f2397dfad5f4bbd12c64be86e0b7eb4a Author: Kristof Provost AuthorDate: 2022-09-27 13:27:47 +0000 Commit: Kristof Provost CommitDate: 2022-09-27 13:28:37 +0000 pf: fix memory leak retrieving Ethernet rules Remember to free the nvlist we've added to our main nvlist. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_nv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c index 456433ccbf70..18495c118e75 100644 --- a/sys/netpfil/pf/pf_nv.c +++ b/sys/netpfil/pf/pf_nv.c @@ -1067,6 +1067,7 @@ pf_keth_rule_to_nveth_rule(const struct pf_keth_rule *krule) return (NULL); } nvlist_add_nvlist(nvl, "src", addr); + nvlist_destroy(addr); addr = pf_keth_rule_addr_to_nveth_rule_addr(&krule->dst); if (addr == NULL) { @@ -1074,6 +1075,7 @@ pf_keth_rule_to_nveth_rule(const struct pf_keth_rule *krule) return (NULL); } nvlist_add_nvlist(nvl, "dst", addr); + nvlist_destroy(addr); addr = pf_rule_addr_to_nvrule_addr(&krule->ipsrc); if (addr == NULL) {