diff options
author | michal <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-02 08:02:56 +0000 |
---|---|---|
committer | michal <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-02 08:02:56 +0000 |
commit | 844de6b24b8152dc2f11ef3636e1dae91978a6f3 (patch) | |
tree | 8e7fa6a79d123825404e9a4139d9515ffef240cc /file.c | |
parent | 674f0aa4782afec2748900c601f9288e56a91bae (diff) |
fix mem leak in rb_file_s_readlink() (ruby-core:394)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1301,7 +1301,10 @@ rb_file_s_readlink(klass, path) size *= 2; buf = xrealloc(buf, size); } - if (rv < 0) rb_sys_fail(RSTRING(path)->ptr); + if (rv < 0) { + free(buf); + rb_sys_fail(RSTRING(path)->ptr); + } v = rb_tainted_str_new(buf, rv); free(buf); |