From nobody Thu Oct 13 08:52:38 2022 X-Original-To: dev-commits-src-main@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 4Mp3F233rzz4fT0G; Thu, 13 Oct 2022 08:52:38 +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 4Mp3F22YvCz3wKR; Thu, 13 Oct 2022 08:52:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665651158; 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=A/D+hab3p9Hn3y2Rpx0xmQUz4SjGfNfQhWnXaO2aJ1M=; b=Gmnv8mapX8sB9wmoYqyVLoW/rKXDFjdzNeBcQlPm4j7tpWlWUkiHg0HD2XV4lHYj7HSQo7 waTuCIWqm+qYQLNT6+MRWeCaGrFtyRkP4gbQeiwiDkdEUJlXMtMCc+o75c3/UQYmA2CGpz XSlatbgy4C0AxOFON5B+ThYD5fkxETGYHxpwXzJbsmvBV49sea3uk2TNbobN8nzgr12A2y ayHEzWDZAAV/iB2c13LRJLhjmAWeBKGG8pECckqzrb9uKMCU9R9J7WCWY2gKNUmDo7g9r5 kjWHCSLUoIY2/D848HnftVmPh27lIeQjVz61EYDHFC0GwdNqgXJp4/hdjy0OAQ== 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 4Mp3F21bQLzMnf; Thu, 13 Oct 2022 08:52:38 +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 29D8qcEs013353; Thu, 13 Oct 2022 08:52:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29D8qc9O013352; Thu, 13 Oct 2022 08:52:38 GMT (envelope-from git) Date: Thu, 13 Oct 2022 08:52:38 GMT Message-Id: <202210130852.29D8qc9O013352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 226e41467ee1 - main - sort: deindent file_reader_free and cleanup its usage List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 226e41467ee15c7aba33d59ee7b512b984b182e7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665651158; 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=A/D+hab3p9Hn3y2Rpx0xmQUz4SjGfNfQhWnXaO2aJ1M=; b=m+NO/YwgtJA81JN14aE3adVUAPMvlXiA2gopjrBb0dSIeh5ab7AIicIllS2HRAcoH+/3/n TUDJQRvKjJKslh7FaFON875hzY4K9e2Ueg6VGNLjWj0+825i7wX1ANtqK/gCl7OMfc5VzC D35FptDm5zFDo4OKaGXshYuFtx1jhUhyW4A/qrjGDHrookmNcmA7Cr4iXpidtw+uuOaUmm +ac1Hd4rg32V+f+/Og/zCC5DFYSCfPbtwoK5aRlsVUXye6SHXnVC7rqddI55mKn0PmwvVv s0hGiMtf2dsIc2WaP0zL8Ivi/JfegQKINnV3x634W56T6VGMwKvskbg90al2og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665651158; a=rsa-sha256; cv=none; b=NQney1GjRYLTIDluoPWRHo5tnJOg0mVMcK0909jCnWucwFIaFMo1MRssiWMnpWAqiL+UOa 8PB4wrnoAkITROdcedFab3U3B0fPI6UbM4EIIhVeaQtuBRhSaPdTEWpOttO7kG4FbMKNsL A4o5B+9jYE62JYk6BdVTVtsQrZy2A16E7SRcX+yCvLJYkyBLOaQP2gQuAL4o6SYkX9fYIK uWSEin/cyKyletc0g9Qsw4KHJbKzyxtveutjjtwnja13x6IadwhBAdwaLKhSpQE/cxkhUP PU1eNITsJRAxAA5/JFsfYIAqdNXiwe6pKIYSxm7s6BE5rsbIsUInHrqcBdXjig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=226e41467ee15c7aba33d59ee7b512b984b182e7 commit 226e41467ee15c7aba33d59ee7b512b984b182e7 Author: Baptiste Daroussin AuthorDate: 2022-10-13 08:51:17 +0000 Commit: Baptiste Daroussin CommitDate: 2022-10-13 08:51:17 +0000 sort: deindent file_reader_free and cleanup its usage --- usr.bin/sort/file.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/usr.bin/sort/file.c b/usr.bin/sort/file.c index 0f1a9e6bad4d..dfd13f61ea25 100644 --- a/usr.bin/sort/file.c +++ b/usr.bin/sort/file.c @@ -717,10 +717,10 @@ void file_reader_free(struct file_reader *fr) { - if (fr) { - file_reader_clean(fr); - sort_free(fr); - } + if (fr == NULL) + return; + file_reader_clean(fr); + free(fr); } int @@ -820,10 +820,8 @@ file_header_close(struct file_header **fh) { if (fh && *fh) { - if ((*fh)->fr) { - file_reader_free((*fh)->fr); - (*fh)->fr = NULL; - } + file_reader_free((*fh)->fr); + (*fh)->fr = NULL; if ((*fh)->si) { sort_list_item_clean((*fh)->si); sort_free((*fh)->si);