diff options
author | mmcc <mmcc@cvs.openbsd.org> | 2015-12-28 22:27:04 +0000 |
---|---|---|
committer | mmcc <mmcc@cvs.openbsd.org> | 2015-12-28 22:27:04 +0000 |
commit | 80b98c8b13fd23d28de350b5ce887030eca71f13 (patch) | |
tree | 77d71e670b38fb46dc07343f8130de9e7141977e /lib/libc/regex | |
parent | ab78c0c999f03e6d45f0415a5e9905b3440f2be1 (diff) |
Remove NULL-checks before free() and unnecessary argument casts.
ok tb@
Diffstat (limited to 'lib/libc/regex')
-rw-r--r-- | lib/libc/regex/regfree.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/libc/regex/regfree.c b/lib/libc/regex/regfree.c index ae962745ab4..1145739a482 100644 --- a/lib/libc/regex/regfree.c +++ b/lib/libc/regex/regfree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: regfree.c,v 1.10 2015/12/28 22:08:18 mmcc Exp $ */ +/* $OpenBSD: regfree.c,v 1.11 2015/12/28 22:27:03 mmcc Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 Henry Spencer. * Copyright (c) 1992, 1993, 1994 @@ -60,13 +60,10 @@ regfree(regex_t *preg) preg->re_magic = 0; /* mark it invalid */ g->magic = 0; /* mark it invalid */ - if (g->strip != NULL) - free((char *)g->strip); - if (g->sets != NULL) - free((char *)g->sets); - if (g->setbits != NULL) - free((char *)g->setbits); + free(g->strip); + free(g->sets); + free(g->setbits); free(g->must); - free((char *)g); + free(g); } DEF_WEAK(regfree); |