Found by: valgrind
svn path=/trunk/yasm/; revision=2072
State_new(void)
{
State *s = malloc(sizeof(State));
+ s->label = 0;
s->rule = NULL;
+ s->next = NULL;
s->link = NULL;
+ s->depth = 0;
s->kCount = 0;
s->kernel = NULL;
+ s->isBase = 0;
s->action = NULL;
s->go.nSpans = 0;
s->go.span = NULL;
s->lim -= cnt;
}
if((s->top - s->lim) < BSIZE){
- unsigned char *buf = malloc(((s->lim - s->bot) + BSIZE));
+ unsigned char *buf = malloc(((s->lim - s->bot) + BSIZE) + 1);
memcpy(buf, s->tok, s->lim - s->tok);
s->tok = buf;
s->ptr = &buf[s->ptr - s->bot];
s->lim -= cnt;
}
if((s->top - s->lim) < BSIZE){
- unsigned char *buf = malloc(((s->lim - s->bot) + BSIZE));
+ unsigned char *buf = malloc(((s->lim - s->bot) + BSIZE) + 1);
memcpy(buf, s->tok, s->lim - s->tok);
s->tok = buf;
s->ptr = &buf[s->ptr - s->bot];