svn commit: r281858 - head/lib/libc/regex

Pedro F. Giffuni pfg at FreeBSD.org
Wed Apr 22 17:09:03 UTC 2015


Author: pfg
Date: Wed Apr 22 17:09:02 2015
New Revision: 281858
URL: https://svnweb.freebsd.org/changeset/base/281858

Log:
  computematchjumps(): fix allocator sizeof operand mismatch.
  
  Mostly cosmetical warning.
  
  Found by:	Clang static analyzer

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

Modified: head/lib/libc/regex/regcomp.c
==============================================================================
--- head/lib/libc/regex/regcomp.c	Wed Apr 22 16:51:21 2015	(r281857)
+++ head/lib/libc/regex/regcomp.c	Wed Apr 22 17:09:02 2015	(r281858)
@@ -1726,13 +1726,13 @@ computematchjumps(struct parse *p, struc
 	if (p->error != 0)
 		return;
 
-	pmatches = (int*) malloc(g->mlen * sizeof(unsigned int));
+	pmatches = (int*) malloc(g->mlen * sizeof(int));
 	if (pmatches == NULL) {
 		g->matchjump = NULL;
 		return;
 	}
 
-	g->matchjump = (int*) malloc(g->mlen * sizeof(unsigned int));
+	g->matchjump = (int*) malloc(g->mlen * sizeof(int));
 	if (g->matchjump == NULL) {	/* Not a fatal error */
 		free(pmatches);
 		return;


More information about the svn-src-all mailing list