summaryrefslogtreecommitdiff
path: root/lib/libc/regex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/regex')
-rw-r--r--lib/libc/regex/regcomp.c5
-rw-r--r--lib/libc/regex/regfree.c5
2 files changed, 4 insertions, 6 deletions
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c
index f02b753f8ac..e455a571c68 100644
--- a/lib/libc/regex/regcomp.c
+++ b/lib/libc/regex/regcomp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: regcomp.c,v 1.27 2015/11/01 03:45:29 guenther Exp $ */
+/* $OpenBSD: regcomp.c,v 1.28 2015/12/28 22:08:18 mmcc Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994 Henry Spencer.
* Copyright (c) 1992, 1993, 1994
@@ -1184,8 +1184,7 @@ mcadd( struct parse *p, cset *cs, char *cp)
cs->smultis += strlen(cp) + 1;
np = realloc(cs->multis, cs->smultis);
if (np == NULL) {
- if (cs->multis)
- free(cs->multis);
+ free(cs->multis);
cs->multis = NULL;
SETERROR(REG_ESPACE);
return;
diff --git a/lib/libc/regex/regfree.c b/lib/libc/regex/regfree.c
index 82f506ab826..ae962745ab4 100644
--- a/lib/libc/regex/regfree.c
+++ b/lib/libc/regex/regfree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: regfree.c,v 1.9 2015/09/14 12:22:49 guenther Exp $ */
+/* $OpenBSD: regfree.c,v 1.10 2015/12/28 22:08:18 mmcc Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994 Henry Spencer.
* Copyright (c) 1992, 1993, 1994
@@ -66,8 +66,7 @@ regfree(regex_t *preg)
free((char *)g->sets);
if (g->setbits != NULL)
free((char *)g->setbits);
- if (g->must != NULL)
- free(g->must);
+ free(g->must);
free((char *)g);
}
DEF_WEAK(regfree);