Raymond Toy pushed to branch issue-437-find-self at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/lisp/lisp.c
    ... ... @@ -143,6 +143,11 @@ default_cmucllib(const char *argv0arg)
    143 143
         char *cwd;
    
    144 144
         char *newpath = malloc(PATH_MAX);
    
    145 145
     
    
    146
    +    if (!newpath) {
    
    147
    +	perror("Failed to malloc space for newpath");
    
    148
    +	exit(1);
    
    149
    +    }
    
    150
    +
    
    146 151
         cwd = realpath(argv0arg, newpath);
    
    147 152
     
    
    148 153
         if (debug_lisp_search) {
    
    ... ... @@ -195,6 +200,11 @@ default_cmucllib(const char *argv0arg)
    195 200
         /* Create the colon separated list of directories */
    
    196 201
     
    
    197 202
         defpath = malloc(total_len + 1);
    
    203
    +    if (!defpath) {
    
    204
    +	perror("Failed to malloc space for cmucllib");
    
    205
    +	exit(1);
    
    206
    +    }
    
    207
    +    
    
    198 208
         *defpath = '\0';
    
    199 209
     
    
    200 210
         ptr = cmucllib_search_list;