git: b4572fe56573 - stable/13 - sort: deindent file_reader_free and cleanup its usage

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Wed, 19 Oct 2022 08:01:39 UTC
The branch stable/13 has been updated by bapt:

URL: https://cgit.FreeBSD.org/src/commit/?id=b4572fe565737c978f64516c7c355f160bda9d15

commit b4572fe565737c978f64516c7c355f160bda9d15
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2022-10-13 08:51:17 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
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);