summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authormmcc <mmcc@cvs.openbsd.org>2015-12-28 23:01:23 +0000
committermmcc <mmcc@cvs.openbsd.org>2015-12-28 23:01:23 +0000
commit8be133804b3f5f4ba125c4d519374bd5b3a29498 (patch)
treee3e7aefc17af125fbf1987495fb139ac73da29b0 /lib/libc
parenta6bb008fcbef217b4ac5070e4e0e9a68a3cf9cbc (diff)
Remove NULL-checks before free() and needless argument casts.
ok tb@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/regex/engine.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libc/regex/engine.c b/lib/libc/regex/engine.c
index 95b8a8ff64b..fe7b0ff9133 100644
--- a/lib/libc/regex/engine.c
+++ b/lib/libc/regex/engine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: engine.c,v 1.18 2014/10/09 02:50:16 deraadt Exp $ */
+/* $OpenBSD: engine.c,v 1.19 2015/12/28 23:01:22 mmcc Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994 Henry Spencer.
@@ -277,10 +277,8 @@ matcher(struct re_guts *g, char *string, size_t nmatch, regmatch_t pmatch[],
}
}
- if (m->pmatch != NULL)
- free((char *)m->pmatch);
- if (m->lastpos != NULL)
- free((char *)m->lastpos);
+ free(m->pmatch);
+ free(m->lastpos);
STATETEARDOWN(m);
return(0);
}