MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

null check for realloc

+2 -1
+2 -1
src/repl.c
··· 427 427 static void push_template(parse_state_t *s) { 428 428 if (s->template_count >= s->template_cap) { 429 429 s->template_cap = s->template_cap ? s->template_cap * 2 : 8; 430 - s->templates = realloc(s->templates, s->template_cap * sizeof(int)); 430 + int *new_templates = realloc(s->templates, s->template_cap * sizeof(int)); 431 + if (!new_templates) { return; } s->templates = new_templates; 431 432 } 432 433 s->templates[s->template_count++] = s->brace; 433 434 }