From nobody Fri Oct 20 14:07:16 2023 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 4SBmcN4hcJz4xpmp; Fri, 20 Oct 2023 14:07:16 +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 4SBmcN45zzz4ktC; Fri, 20 Oct 2023 14:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697810836; 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=x9zae9zItOh4kWX8HMzzoUwRIMFmOPumBKfqWRWRxUY=; b=QWeZo3wK4xEDlUL3UBev13fDpwmKFWLnx2GPFTt8Dbz21qDh7W25pa0MlKQj4L/b4WaMcd /eQb6OPn/Axs0A+eExVUymgLS7m41nRif6zb2n8+wfwRoGGeAyjaCMHmmXjSBym3zSHVZG ekvTb8wzrGlUYLuVhPJIT0brovyBdsqeqzrh+nrbW3C0FkXz3qrywxNZHDOvxWusqDGz+t IjhV6hFlhpZkF1tGPboITQPErfrGbP7wBgAEZDa2R4lwgYeC7h+/LoeAkerWT/413ABAQj In9+7sh52+QtLRrpuJ+/I/IFMSLqOvCO4oFKtRvoIXEESDwcjrThkNiknoASRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697810836; a=rsa-sha256; cv=none; b=OA5KMtmHAPpqE8B4Xj7/PcGExjqAUH7OkdNx/pdA47lRaEH0i1huWeU9q+EAbA0DuHsVQT esBiTRKmFUwDJHbbXKLV3mjlL4G3WGUSGrpsZKKOgaqYfTHyL6m4riUBNMExpsjcCsCUep /S7JoJ8REZpevyXvx+A/jKFxjEDz5DJq/d3yKsZAdEKbE1ni4xGXAipK4OZp+O6HJfKbE7 mF/2hZIeULAydleAwcNQsMi+ca6L0wLSynuc2i/JZWaSKEQN50MG8I4Ty9W+m3Y+X/b6no cuFNgmuxhb/9JBleJuft3wMGXf1siQyh8mnYFY3kH2aK1urzEDVD+iVAj3Rb5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697810836; 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=x9zae9zItOh4kWX8HMzzoUwRIMFmOPumBKfqWRWRxUY=; b=jUmmMnR6EYA4ciWuik5+ZC4Ye04xUENHSgsx6+TnTVekcHVCMOQkgq03+rLtFwM44WXJqY +svRkeOXnJBvlWf2tFIILPhuIimoOb7OEBAbjOXH3Z4pKwPGDzx43+lLZQ+aky/0F70Qxg wQ51WAHkIbrMHXYtxVWLnVksxhnT7akElmQ5W+WJ7JPxuHlIWjyvnHHwIp6jQK5Kin3LSp BKaLwMiLbTEQsYvxAvjPGHpsSLLnLBs1/n5oTLF9Ez3T4Z4HXXXl9FzaJFhdQYYTSDEg9o 9R4FT5vSfbxEx+oMfiaExwdDq/mXUL0h0nKuIBXox8LjOgbqKp27NiB5NZTzkA== 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 4SBmcN35xSzbtD; Fri, 20 Oct 2023 14:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39KE7Gap039323; Fri, 20 Oct 2023 14:07:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39KE7Gcf039320; Fri, 20 Oct 2023 14:07:16 GMT (envelope-from git) Date: Fri, 20 Oct 2023 14:07:16 GMT Message-Id: <202310201407.39KE7Gcf039320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 6ad6929974e6 - main - netinet tests: Fix leaks in ip6_v4mapped_test 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6ad6929974e6394d57a40f7d43c899963c6ae5ec Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6ad6929974e6394d57a40f7d43c899963c6ae5ec commit 6ad6929974e6394d57a40f7d43c899963c6ae5ec Author: Mark Johnston AuthorDate: 2023-10-20 14:05:58 +0000 Commit: Mark Johnston CommitDate: 2023-10-20 14:05:58 +0000 netinet tests: Fix leaks in ip6_v4mapped_test Reported by: Coverity MFC after: 1 week --- tests/sys/netinet/ip6_v4mapped_test.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/sys/netinet/ip6_v4mapped_test.c b/tests/sys/netinet/ip6_v4mapped_test.c index d4c4ed526ab5..bbc8d11d63ef 100644 --- a/tests/sys/netinet/ip6_v4mapped_test.c +++ b/tests/sys/netinet/ip6_v4mapped_test.c @@ -294,8 +294,7 @@ ATF_TC_BODY(tcp_v4mapped_bind, tc) error = connect(csock, &su_mapped.saddr, su_mapped.saddr.sa_len); if (error != 0 && errno == EADDRINUSE) { /* This is the specific error we were looking for. */ - ATF_REQUIRE_MSG(error == 0, - "client connect %d failed, " + atf_tc_fail("client connect %d failed, " " client had duplicate port: %s", i, strerror(errno)); } @@ -312,6 +311,8 @@ ATF_TC_BODY(tcp_v4mapped_bind, tc) } ATF_REQUIRE_MSG(i >= 1, "No successful connections"); ATF_REQUIRE_MSG(got_bind_error == true, "No expected bind error"); + + ATF_REQUIRE(close(lsock) == 0); } ATF_TC_CLEANUP(tcp_v4mapped_bind, tc) { @@ -365,6 +366,7 @@ ATF_TC_BODY(udp_v4mapped_sendto, tc) ATF_REQUIRE_MSG(error == 0, "getaddrinfo: %s", gai_strerror(error)); memcpy(&sin6, aip->ai_addr, sizeof(sin6)); sin6.sin6_port = port; + freeaddrinfo(aip); ch = 0x42; n = sendto(s, &ch, 1, 0, (struct sockaddr *)&sin6, sizeof(sin6)); @@ -383,6 +385,9 @@ ATF_TC_BODY(udp_v4mapped_sendto, tc) n = recv(ls, &ch, 1, 0); ATF_REQUIRE_MSG(n == 1, "recv() failed: %s", strerror(errno)); ATF_REQUIRE(ch == 0x42); + + ATF_REQUIRE(close(s) == 0); + ATF_REQUIRE(close(ls) == 0); } ATF_TP_ADD_TCS(tp)