diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-27 14:44:32 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-27 14:44:32 +0000 |
commit | 9073db5cb1d3173aff62be5b48d00f0fb2890991 (patch) | |
tree | 1ae5dd06dd31c3bc426e8a1b46cae928f8811525 /io.c | |
parent | 61dc4a8dbc2cdc9a24ce206ad0ec911267bb6782 (diff) | |
download | bundler-9073db5cb1d3173aff62be5b48d00f0fb2890991.tar.gz |
* io.c (io_unread): fixed memory leak. report by nagachika via IRC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -473,6 +473,7 @@ io_unread(rb_io_t *fptr) } read_size = _read(fptr->fd, buf, fptr->rbuf.len + newlines); if (read_size < 0) { + free(buf); rb_sys_fail_path(fptr->pathv); } if (read_size == fptr->rbuf.len) { @@ -483,6 +484,7 @@ io_unread(rb_io_t *fptr) newlines--; } } + free(buf); fptr->rbuf.off = 0; fptr->rbuf.len = 0; return; |