Raymond Toy pushed to branch issue-130-file-author-in-c at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/lisp/os-common.c
    ... ... @@ -783,13 +783,20 @@ os_file_author(const char *path)
    783 783
         }
    
    784 784
         
    
    785 785
         if (result) {
    
    786
    +        fprintf(stderr, "Allocate %d bytes for author\n",
    
    787
    +                strlen(result->pw_name + 1));
    
    788
    +        
    
    786 789
             author = malloc(strlen(result->pw_name + 1));
    
    787 790
             if (author) {
    
    791
    +            fprintf(stderr, "author = %p\n", author);
    
    788 792
                 strcpy(author, result->pw_name);
    
    789 793
             }
    
    790 794
         }
    
    791 795
     
    
    792
    -    free(buf);
    
    796
    +    fprintf(stderr, "Free buf %p\n", buf);
    
    797
    +    if (buf) {
    
    798
    +        free(buf);
    
    799
    +    }
    
    793 800
     
    
    794 801
         return author;
    
    795 802
     }