aboutsummaryrefslogtreecommitdiff
path: root/libio
diff options
context:
space:
mode:
Diffstat (limited to 'libio')
-rw-r--r--libio/fmemopen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libio/fmemopen.c b/libio/fmemopen.c
index bf996d4058..92df2e4424 100644
--- a/libio/fmemopen.c
+++ b/libio/fmemopen.c
@@ -183,7 +183,8 @@ fmemopen_close (void *cookie)
c = (fmemopen_cookie_t *) cookie;
- free (c->buffer);
+ if (c->mybuffer)
+ free (c->buffer);
free (c);
return 0;