Check the return value from malloc - do not assume that we were
allocated memory just because we asked for it.
Update #4415.
R=minux.ma, daniel.morsing, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/
6782100
case '[':
if(loophack || lstk != nil) {
h = malloc(sizeof *h);
+ if(h == nil) {
+ flusherrors();
+ yyerror("out of memory");
+ errorexit();
+ }
h->v = loophack;
h->next = lstk;
lstk = h;
}
n->initorder = InitPending;
l = malloc(sizeof *l);
+ if(l == nil) {
+ flusherrors();
+ yyerror("out of memory");
+ errorexit();
+ }
l->next = initlist;
l->n = n;
l->end = nil;