git: 226e41467ee1 - main - sort: deindent file_reader_free and cleanup its usage
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 13 Oct 2022 08:52:38 UTC
The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=226e41467ee15c7aba33d59ee7b512b984b182e7 commit 226e41467ee15c7aba33d59ee7b512b984b182e7 Author: Baptiste Daroussin <bapt@FreeBSD.org> AuthorDate: 2022-10-13 08:51:17 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> 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);