summaryrefslogtreecommitdiff
path: root/libc/stdio/open_memstream.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-05-20 20:39:38 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-05-20 20:39:38 +0000
commit88917b0f143e2eac468aea14338b4d9eddba389d (patch)
tree790fd49f0632b93a7ad9cd02974bff82efa60b25 /libc/stdio/open_memstream.c
parent43eb269ab1d216074e18dadc74c9671398dfe938 (diff)
replace "if (p) free(p)" by just "free(p)" - free(NULL) is safe.
Diffstat (limited to 'libc/stdio/open_memstream.c')
-rw-r--r--libc/stdio/open_memstream.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libc/stdio/open_memstream.c b/libc/stdio/open_memstream.c
index 71c437c78..a9327608a 100644
--- a/libc/stdio/open_memstream.c
+++ b/libc/stdio/open_memstream.c
@@ -160,9 +160,7 @@ FILE *open_memstream(char **__restrict bufloc, size_t *__restrict sizeloc)
}
}
- if (cookie->buf != NULL) {
- free(cookie->buf);
- }
+ free(cookie->buf);
EXIT_cookie:
free(cookie);