diff options
author | 2015-12-28 22:08:18 +0000 | |
---|---|---|
committer | 2015-12-28 22:08:18 +0000 | |
commit | b4c66e9d35799de272ab90c8189d8cc311f97053 (patch) | |
tree | 553ba46476200501cc8855419b9aaf42b39d3ef8 /lib/libc/regex/regcomp.c | |
parent | Build most of games/ with -Werror-implicit-function-declaration. (diff) | |
download | wireguard-openbsd-b4c66e9d35799de272ab90c8189d8cc311f97053.tar.xz wireguard-openbsd-b4c66e9d35799de272ab90c8189d8cc311f97053.zip |
Remove NULL-checks before free() and a few related dead assignments.
ok and valuable input from millert@
Diffstat (limited to 'lib/libc/regex/regcomp.c')
-rw-r--r-- | lib/libc/regex/regcomp.c | 5 |
1 files changed, 2 insertions, 3 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; |