diff --git a/sys/src/libsat/misc.c b/sys/src/libsat/misc.c index e7e843529..f62aed431 100644 --- a/sys/src/libsat/misc.c +++ b/sys/src/libsat/misc.c @@ -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; } diff --git a/sys/src/libsat/satsolve.c b/sys/src/libsat/satsolve.c index 94dec8598..78728fc8c 100644 --- a/sys/src/libsat/satsolve.c +++ b/sys/src/libsat/satsolve.c @@ -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);