Carl Shapiro pushed to branch master at cmucl / cmucl
Commits: 0319c582 by Carl Shapiro at 2024-04-28T12:05:17-07:00 Abort if make_var cannot allocate memory with malloc
There are two calls to malloc in this function. Previously, just the first checked for an error. This change adds a similar check to the second call.
- - - - - 1b3171cd by Carl Shapiro at 2024-07-25T07:12:17+00:00 Merge branch 'vars-c-unchecked-malloc' into 'master'
Abort if make_var cannot allocate memory with malloc
See merge request cmucl/cmucl!216 - - - - -
1 changed file:
- src/lisp/vars.c
Changes:
===================================== src/lisp/vars.c ===================================== @@ -128,6 +128,10 @@ make_var(char *name, boolean perm) name = buffer; } var->name = (char *) malloc(strlen(name) + 1); + if (var->name == NULL) { + perror("malloc"); + exit(1); + } strcpy(var->name, name); var->clock = 0; var->permanent = perm;
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/1b1695810a359432b0be432...