Actions
Bug #9187
closedst_table leaks when exception is raised in Hash#rehash
Description
Following code causes leakage of st_table:
class Foo
def initialize
@raise = false
end
def hash
raise if @raise
@raise = true
return 0
end
end
h = {Foo.new => true}
10_0000.times do
h.rehash rescue nil
end
Updated by Anonymous about 11 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r43942.
Masaki, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- hash.c (
rb_hash_rehash
): fix to free newst_table
when exception
is raised indo_hash()
. [Bug #9187]
Updated by usa (Usaku NAKAMURA) almost 11 years ago
- Backport changed from 1.9.3: REQUIRED, 2.0.0: REQUIRED to 1.9.3: DONE, 2.0.0: REQUIRED
backported into ruby_1_9_3
at r44948.
Updated by nagachika (Tomoyuki Chikanaga) almost 11 years ago
- Backport changed from 1.9.3: DONE, 2.0.0: REQUIRED to 1.9.3: DONE, 2.0.0: DONE
r43942, r43957 and r43975 were backported to ruby_2_0_0
at r45011.
Updated by nobu (Nobuyoshi Nakada) almost 11 years ago
- Description updated (diff)
Actions
Like0
Like0Like0Like0Like0