xxyzz / ostep-hw

Operating Systems: Three Easy Pieces(OSTEP) homework and project solutions
GNU General Public License v3.0
763 stars 179 forks source link

/initial-reverse/reverse.c #9

Closed hzylyq closed 3 years ago

hzylyq commented 3 years ago

I have a question.

if ((head->line = malloc(linecap)) == NULL) { fprintf(stderr, "reverse: malloc failed\n"); exit(EXIT_FAILURE); } when malloc failed. head won't be free

xxyzz commented 3 years ago

Thanks!