fix null dereference crash in mothra

This commit is contained in:
jpathy 2013-09-24 15:50:35 -07:00
parent 62b3eea271
commit cafcffb1dc

View file

@ -1016,11 +1016,13 @@ mothon(Www *w, int on)
plrtstr(&t->next, 0, 0, t->font, strdup("->"), PL_HOT, ap); plrtstr(&t->next, 0, 0, t->font, strdup("->"), PL_HOT, ap);
t->next->next = x; t->next->next = x;
} else { } else {
if(x) {
t->next = x->next; t->next = x->next;
x->next = nil; x->next = nil;
freetext(x); freetext(x);
} }
} }
}
updtext(w); updtext(w);
donecurs(); donecurs();
} }