summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/regex/regfree.c13
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);