Message ID | CAPmKWpG+tiYAu6gP177E8FiTYGXe0dSdd6ahfzx0pfEqLOSTaA@mail.gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | [uclibc-ng-devel] Fix NULL pointer dereference in open_memstream() | expand |
diff --git a/libc/stdio/open_memstream.c b/libc/stdio/open_memstream.c index 17ef191cb..71a84138d 100644 --- a/libc/stdio/open_memstream.c +++ b/libc/stdio/open_memstream.c @@ -156,9 +156,10 @@ FILE *open_memstream(char **bufloc, size_t *sizeloc) __STDIO_STREAM_VALIDATE(fp); return fp; } + + free(cookie->buf); } - free(cookie->buf); EXIT_cookie: free(cookie);