From owner-svn-src-stable-12@freebsd.org Sun Mar 22 15:01:13 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1FA7264177; Sun, 22 Mar 2020 15:01:13 +0000 (UTC) (envelope-from asomers@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48lggs5h3Bz4ZST; Sun, 22 Mar 2020 15:01:13 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC7D92727D; Sun, 22 Mar 2020 15:01:13 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 02MF1DY9054534; Sun, 22 Mar 2020 15:01:13 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 02MF1DL7054532; Sun, 22 Mar 2020 15:01:13 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202003221501.02MF1DL7054532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 22 Mar 2020 15:01:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r359211 - stable/12/tests/sys/fs/fusefs X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/tests/sys/fs/fusefs X-SVN-Commit-Revision: 359211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2020 15:01:14 -0000 Author: asomers Date: Sun Mar 22 15:01:13 2020 New Revision: 359211 URL: https://svnweb.freebsd.org/changeset/base/359211 Log: MFC r357835: fusefs: fix some memory leaks in the tests. Oddly, most of these were not detected by Coverity. Reported by: Coverity (one of them, anyway) Coverity CID: 1404490 Modified: stable/12/tests/sys/fs/fusefs/read.cc stable/12/tests/sys/fs/fusefs/write.cc Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/fs/fusefs/read.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/read.cc Sun Mar 22 12:57:49 2020 (r359210) +++ stable/12/tests/sys/fs/fusefs/read.cc Sun Mar 22 15:01:13 2020 (r359211) @@ -778,6 +778,7 @@ TEST_F(Read, cache_block) ASSERT_EQ(bufsize, read(fd, buf, bufsize)) << strerror(errno); ASSERT_EQ(0, memcmp(buf, contents1, bufsize)); leak(fd); + free(contents); } /* Reading with sendfile should work (though it obviously won't be 0-copy) */ @@ -899,6 +900,8 @@ TEST_P(ReadAhead, readahead) { ASSERT_EQ(0, memcmp(rbuf, contents, bufsize)); leak(fd); + free(rbuf); + free(contents); } INSTANTIATE_TEST_CASE_P(RA, ReadAhead, Modified: stable/12/tests/sys/fs/fusefs/write.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/write.cc Sun Mar 22 12:57:49 2020 (r359210) +++ stable/12/tests/sys/fs/fusefs/write.cc Sun Mar 22 15:01:13 2020 (r359211) @@ -300,6 +300,8 @@ TEST_F(Write, append_to_cached) /* Write the new data. There should be no more read operations */ ASSERT_EQ(BUFSIZE, write(fd, CONTENTS, BUFSIZE)) << strerror(errno); leak(fd); + free(oldbuf); + free(oldcontents); } TEST_F(Write, append_direct_io) @@ -782,6 +784,8 @@ TEST_F(WriteCluster, clustering) << strerror(errno); } close(fd); + free(wbuf2x); + free(wbuf); } /* @@ -825,6 +829,7 @@ TEST_F(WriteCluster, DISABLED_cluster_write_err) << strerror(errno); } close(fd); + free(wbuf); } /*