summaryrefslogtreecommitdiffstats
path: root/usr.bin/lex
diff options
context:
space:
mode:
authormmcc <mmcc@openbsd.org>2015-12-11 00:08:43 +0000
committermmcc <mmcc@openbsd.org>2015-12-11 00:08:43 +0000
commite934d5c6a329a93f943f426d3c75deecc09735e9 (patch)
treeb624b0e3025cdbb7573365ece26f44449a8fc1c7 /usr.bin/lex
parent"the the" -> "the" in comment (diff)
downloadwireguard-openbsd-e934d5c6a329a93f943f426d3c75deecc09735e9.tar.xz
wireguard-openbsd-e934d5c6a329a93f943f426d3c75deecc09735e9.zip
Remove a few NULL-checks before free(). I've already removed these
upstream.
Diffstat (limited to 'usr.bin/lex')
-rw-r--r--usr.bin/lex/main.c5
-rw-r--r--usr.bin/lex/scanopt.c5
-rw-r--r--usr.bin/lex/tables.c5
3 files changed, 6 insertions, 9 deletions
diff --git a/usr.bin/lex/main.c b/usr.bin/lex/main.c
index ae4253b771d..15a1953afe2 100644
--- a/usr.bin/lex/main.c
+++ b/usr.bin/lex/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.24 2015/11/20 04:07:43 millert Exp $ */
+/* $OpenBSD: main.c,v 1.25 2015/12/11 00:08:43 mmcc Exp $ */
/* flex - tool to generate fast lexical analyzers */
@@ -387,8 +387,7 @@ check_options()
}
if ((tablesout = fopen(tablesfilename, "w")) == NULL)
lerrsf(_("could not create %s"), tablesfilename);
- if (pname)
- free(pname);
+ free(pname);
tablesfilename = 0;
yytbl_writer_init(&tableswr, tablesout);
diff --git a/usr.bin/lex/scanopt.c b/usr.bin/lex/scanopt.c
index aab0d67c3fd..acab2a3c3bc 100644
--- a/usr.bin/lex/scanopt.c
+++ b/usr.bin/lex/scanopt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scanopt.c,v 1.4 2015/11/20 00:05:02 mmcc Exp $ */
+/* $OpenBSD: scanopt.c,v 1.5 2015/12/11 00:08:43 mmcc Exp $ */
/* flex - tool to generate fast lexical analyzers */
@@ -864,8 +864,7 @@ int scanopt_destroy (svoid)
s = (struct _scanopt_t *) svoid;
if (s) {
- if (s->aux)
- free (s->aux);
+ free(s->aux);
free (s);
}
return 0;
diff --git a/usr.bin/lex/tables.c b/usr.bin/lex/tables.c
index 8efda6b9a21..d58ecb584ce 100644
--- a/usr.bin/lex/tables.c
+++ b/usr.bin/lex/tables.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tables.c,v 1.2 2015/11/19 22:16:43 tedu Exp $ */
+/* $OpenBSD: tables.c,v 1.3 2015/12/11 00:08:43 mmcc Exp $ */
/* tables.c - tables serialization code
*
@@ -117,8 +117,7 @@ int yytbl_data_init (struct yytbl_data *td, enum yytbl_id id)
*/
int yytbl_data_destroy (struct yytbl_data *td)
{
- if (td->td_data)
- free (td->td_data);
+ free(td->td_data);
td->td_data = 0;
free (td);
return 0;