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

Alexey Dokuchaev danfe at FreeBSD.org
Wed Apr 22 17:15:42 UTC 2015


On Wed, Apr 22, 2015 at 05:09:03PM +0000, Pedro F. Giffuni wrote:
> New Revision: 281858
> URL: https://svnweb.freebsd.org/changeset/base/281858
> 
> Log:
>   computematchjumps(): fix allocator sizeof operand mismatch.
> [...]
> -	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));

Since you've touched these lines, you could'be also removed (int *)
casting from malloc() calls.  But now it's too late (does not warrant
another commit).

./danfe


More information about the svn-src-head mailing list