Bug #9645

[PATCH] variable.c: avoid memory leak on const redefinition

Added by Eric Wong over 1 year ago. Updated about 1 year ago.

[ruby-core:61546]
Status:Closed
Priority:Normal
Assignee:Eric Wong
ruby -v:ruby 2.2.0dev (2014-03-16 trunk 45349) [x86_64-linux] Backport:2.0.0: DONE, 2.1: DONE

Description

I noticed this leak because I was making constants use ihash from Feature 9614.
I hope nobody is really affected by this leak.

0001-variable.c-avoid-memory-leak-on-const-redefinition.patch Magnifier (1.5 KB) Eric Wong, 03/17/2014 01:09 AM

Associated revisions

Revision 45350
Added by normal over 1 year ago

variable.c: avoid memory leak on const redefinition

  • variable.c (rb_const_set): delete existing entry on redefinition [Bug #9645]
  • test/ruby/test_const.rb (test_redefinition): test for leak

Revision 45350
Added by normal over 1 year ago

variable.c: avoid memory leak on const redefinition

  • variable.c (rb_const_set): delete existing entry on redefinition [Bug #9645]
  • test/ruby/test_const.rb (test_redefinition): test for leak

Revision 45373
Added by Tomoyuki Chikanaga over 1 year ago

merge revision(s) r45350: [Backport #9645]

* variable.c (rb_const_set): delete existing entry on redefinition
  [Bug #9645]

* test/ruby/test_const.rb (test_redefinition): test for leak

Revision 46301
Added by Tomoyuki Chikanaga about 1 year ago

merge revision(s) r45350: [Backport #9645]

* variable.c (rb_const_set): delete existing entry on redefinition
  [Bug #9645]

* test/ruby/test_const.rb (test_redefinition): test for leak

History

#1 Updated by Anonymous over 1 year ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r45350.


variable.c: avoid memory leak on const redefinition

  • variable.c (rb_const_set): delete existing entry on redefinition [Bug #9645]
  • test/ruby/test_const.rb (test_redefinition): test for leak

#2 Updated by Tomoyuki Chikanaga over 1 year ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: DONE, 2.1: REQUIRED

r45350 was backported to ruby_2_0_0 at r45373.

#3 Updated by Tomoyuki Chikanaga about 1 year ago

  • Backport changed from 2.0.0: DONE, 2.1: REQUIRED to 2.0.0: DONE, 2.1: DONE

Backported into ruby_2_1 branch at r46301.

Also available in: Atom PDF