summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2015-04-01 21:16:17 +0000
committermillert <millert@openbsd.org>2015-04-01 21:16:17 +0000
commited004aa2319f73a408e885987aadec409cb52fd1 (patch)
treedfbc95c26e5e90778599cb4d45a8070235d2acfe
parentNo need for an else clause after a continue, it just makes the (diff)
downloadwireguard-openbsd-ed004aa2319f73a408e885987aadec409cb52fd1.tar.xz
wireguard-openbsd-ed004aa2319f73a408e885987aadec409cb52fd1.zip
No need for if (x) free(x) style checks, this is not K&R.
-rw-r--r--usr.bin/sort/file.c8
-rw-r--r--usr.bin/sort/sort.c14
2 files changed, 8 insertions, 14 deletions
diff --git a/usr.bin/sort/file.c b/usr.bin/sort/file.c
index efc0312f8c2..291d2ef4a69 100644
--- a/usr.bin/sort/file.c
+++ b/usr.bin/sort/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.8 2015/04/01 20:58:13 millert Exp $ */
+/* $OpenBSD: file.c,v 1.9 2015/04/01 21:16:17 millert Exp $ */
/*-
* Copyright (C) 2009 Gabor Kovesdan <gabor@FreeBSD.org>
@@ -746,15 +746,13 @@ file_reader_clean(struct file_reader *fr)
if (fr->fd)
close(fr->fd);
- if (fr->buffer)
- sort_free(fr->buffer);
+ sort_free(fr->buffer);
if (fr->file)
if (fr->file != stdin)
closefile(fr->file, fr->fname);
- if (fr->fname)
- sort_free(fr->fname);
+ sort_free(fr->fname);
memset(fr, 0, sizeof(struct file_reader));
}
diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c
index 7da8b00ab28..74dd3f64aa7 100644
--- a/usr.bin/sort/sort.c
+++ b/usr.bin/sort/sort.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sort.c,v 1.60 2015/04/01 21:13:07 millert Exp $ */
+/* $OpenBSD: sort.c,v 1.61 2015/04/01 21:16:17 millert Exp $ */
/*-
* Copyright (C) 2009 Gabor Kovesdan <gabor@FreeBSD.org>
@@ -619,10 +619,8 @@ parse_pos(const char *s, struct key_specs *ks, bool *mef_flags, bool second)
end:
- if (c)
- sort_free(c);
- if (f)
- sort_free(f);
+ sort_free(c);
+ sort_free(f);
regfree(&re);
return ret;
@@ -739,10 +737,8 @@ parse_pos_obs(const char *s, size_t *nf, size_t *nc, char *sopts,
ret = 0;
end:
- if (c)
- sort_free(c);
- if (f)
- sort_free(f);
+ sort_free(c);
+ sort_free(f);
regfree(&re);
return ret;