Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 May 2014 18:04:57 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r265375 - head/lib/libc/regex
Message-ID:  <201405051804.s45I4vMS022241@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Mon May  5 18:04:57 2014
New Revision: 265375
URL: http://svnweb.freebsd.org/changeset/base/265375

Log:
  Revert r265367:
  Use of calloc instead of malloc in regex (from OpenBSD).
  
  In this case the change makes no sense since we are using realloc() later.
  
  Reported by:	ache

Modified:
  head/lib/libc/regex/regcomp.c

Modified: head/lib/libc/regex/regcomp.c
==============================================================================
--- head/lib/libc/regex/regcomp.c	Mon May  5 17:58:00 2014	(r265374)
+++ head/lib/libc/regex/regcomp.c	Mon May  5 18:04:57 2014	(r265375)
@@ -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 *)calloc(p->ssize, sizeof(sop));
+	p->strip = (sop *)malloc(p->ssize * sizeof(sop));
 	p->slen = 0;
 	if (p->strip == NULL) {
 		free((char *)g);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405051804.s45I4vMS022241>