X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fstdio%2Ffclose.c;h=8fdc3f7d2b667d125e4aa7bc115d53f68e852331;hp=26bc37e8c3dbb82a0292f0f67a8b823b56158fc5;hb=599f97360389911c293e0ca4c5eb49e007377fba;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01 diff --git a/src/stdio/fclose.c b/src/stdio/fclose.c index 26bc37e8..8fdc3f7d 100644 --- a/src/stdio/fclose.c +++ b/src/stdio/fclose.c @@ -9,12 +9,14 @@ int fclose(FILE *f) OFLLOCK(); if (f->prev) f->prev->next = f->next; if (f->next) f->next->prev = f->prev; - if (ofl_head == f) ofl_head = f->next; + if (libc.ofl_head == f) libc.ofl_head = f->next; OFLUNLOCK(); } - r = fflush(f) | f->close(f); + r = fflush(f); + r |= f->close(f); + if (f->getln_buf) free(f->getln_buf); if (!perm) free(f); return r;