diff options
author | pfg <pfg@FreeBSD.org> | 2014-05-05 16:41:15 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2014-05-05 16:41:15 +0000 |
commit | c38af089e6bc9f9a413dff94cb7c26a1db1734c1 (patch) | |
tree | 68da7166bb3565b2e6f4531caaa4f79c46774ec0 /lib/libc/regex | |
parent | 92337e8cda3ec9802043a3eaec53ef101855b865 (diff) | |
download | FreeBSD-src-c38af089e6bc9f9a413dff94cb7c26a1db1734c1.zip FreeBSD-src-c38af089e6bc9f9a413dff94cb7c26a1db1734c1.tar.gz |
regex: Use calloc instead of malloc.
Mostly to reduce differences with OpenBSD.
Obtained from: OpenBSD (CVS rev. 1.17)
MFC after: 3 days
Diffstat (limited to 'lib/libc/regex')
-rw-r--r-- | lib/libc/regex/regcomp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c index 55f9c04..026d772 100644 --- a/lib/libc/regex/regcomp.c +++ b/lib/libc/regex/regcomp.c @@ -214,7 +214,7 @@ regcomp(regex_t * __restrict preg, if (g == NULL) return(REG_ESPACE); p->ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */ - p->strip = (sop *)malloc(p->ssize * sizeof(sop)); + p->strip = (sop *)calloc(p->ssize, sizeof(sop)); p->slen = 0; if (p->strip == NULL) { free((char *)g); |