libsat: setmalloctag, fix incorrect allocation size

This commit is contained in:
aiju 2018-03-20 11:23:41 +00:00
parent 547f60b4c5
commit 5d4a456ae6
2 changed files with 2 additions and 1 deletions

View file

@ -106,6 +106,7 @@ satrealloc(SATSolve *s, void *v, ulong n)
v = realloc(v, n);
if(v == nil)
saterror(s, "realloc: %r");
setmalloctag(v, getcallerpc(&s));
return v;
}

View file

@ -82,7 +82,7 @@ solvinit(SATSolve *s)
{
satdebuginit(s);
satheapreset(s);
s->decbd = satrealloc(s, s->decbd, s->nvar * sizeof(int));
s->decbd = satrealloc(s, s->decbd, (s->nvar + 1) * sizeof(int));
s->decbd[0] = 0;
s->trail = satrealloc(s, s->trail, sizeof(int) * s->nvar);
s->fullrlits = satrealloc(s, s->fullrlits, sizeof(int) * s->nvar);