From nobody Wed Oct 19 08:01:39 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 4MsjqR4F5Nz4gDXq; Wed, 19 Oct 2022 08:01:39 +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 4MsjqR3hVsz40FP; Wed, 19 Oct 2022 08:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666166499; 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=O1Gv4ai9a1u27XfTcZqGU6lujd/O8AttjBw8Zsk397s=; b=Lx5W9aIXOvYyCJDzuTVaAu//QJeiu48VzIISj9GYNOk2UIb6Z0naSxK73NdNl7regKY/os W6vcCGS3LPyvmogu3IDgrM5hbkE/JoO9xCFG+ZxDm697755M/BqmY8aCcEpkm2pmAB3OjF OUZrVuBih2AgHkz2ABFQn6mN81CUpdqxW/daZSoLGrqJz2goHeqL4ChPzua/49H8BXgFCB mKWLHNyXNzKfHYSwyauvdEZ/YtlREoQ6RFa4FOcy6Q5dJlzY+52L6y2kyE7FNSbBLhpTLa lXpoMjSGXrtNLmML9CGqknqGpmJFjvltGPwhfcp6zieKL+CjpzuGUed2MVgapQ== 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 4MsjqR2ny3zSN3; Wed, 19 Oct 2022 08:01:39 +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 29J81dLM061476; Wed, 19 Oct 2022 08:01:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29J81dXR061475; Wed, 19 Oct 2022 08:01:39 GMT (envelope-from git) Date: Wed, 19 Oct 2022 08:01:39 GMT Message-Id: <202210190801.29J81dXR061475@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: b4572fe56573 - stable/13 - sort: deindent file_reader_free and cleanup its usage 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: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b4572fe565737c978f64516c7c355f160bda9d15 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666166499; 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=O1Gv4ai9a1u27XfTcZqGU6lujd/O8AttjBw8Zsk397s=; b=ZsFkVlG0YH+Rq6s4lJozuXnUwl7YiuTkH8loLeIpnRAOfQ1AU2/8dTrfO4Knam0eE3AtKR Tu6QqJoH+len+esxaQuoaTROa08EdLmf71k+6n2wMJttAL0hkwQqO9ZRdMiWA9cFe9xNDT ryI/Ea2ll4x/uMI4igcCHwljHxFJnmXvhoSK2WUrfdhyPyWyjFvkYO+fBKiGIKL9DqSAjx umANwTygv4ECE+cI+45TkjLkf9v87CTo4u0mZrEWN0BPTaGdn10GC4OD9amRBoCrwCQNh4 Ww3xpeCNQmVNtmjuO4MnAfmuqA75xEx/qC1kElDHTTn+MZ/V8rgIuYDWNPsuDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666166499; a=rsa-sha256; cv=none; b=EypgHO/TO0XdRj2g8rvtrg8vHztXAxH9+UAwkeVXx6qCbh4sB/WTe6lwkGA0mJ40wWpJEa eYX5SjxhRlxhTnqoPXcBmzSrBari7l2liadF1D18jDzfGdZnY5md46GCH94+QmSOySh2KY LJ+Q4VxXbCKlAyVaj8E2j9NR5gPD6MQbhHrk1k5pd4QuYjNgDdbqILYxoRScIh41I8YnXT UNxNmYE+YzuMCu8XooKZh8hibNMdr3WRdQwEELYkIVRcuz6dchFvtmRm6CUbQY4lPu5zmB fZLzEUjNKIH9o2vDocm7y6vjhqjS6gjAZtdw4CkQnQd+Q2L7Yi30IjVKaSWZkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=b4572fe565737c978f64516c7c355f160bda9d15 commit b4572fe565737c978f64516c7c355f160bda9d15 Author: Baptiste Daroussin AuthorDate: 2022-10-13 08:51:17 +0000 Commit: Baptiste Daroussin CommitDate: 2022-10-19 07:59:31 +0000 sort: deindent file_reader_free and cleanup its usage (cherry picked from commit 226e41467ee15c7aba33d59ee7b512b984b182e7) --- 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);