computematchjumps(): fix allocator sizeof operand mismatch.

Mostly cosmetical warning.

Found by:	Clang static analyzer
This commit is contained in:
Pedro F. Giffuni 2015-04-22 17:09:02 +00:00
parent 9acf5917d3
commit 12eb0bca33

View File

@ -1726,13 +1726,13 @@ computematchjumps(struct parse *p, struct re_guts *g)
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;