summaryrefslogtreecommitdiff
path: root/gc.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-11 10:45:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-11 10:45:34 +0000
commit96c078c34029bbc525085c4072b7e1ebcc9ec5a3 (patch)
tree12d7aa3e5192ad8c8416ce85889aaaac5e71561e /gc.h
parent18364f541b83eddd3b35fa42077f58a8782369f0 (diff)
* eval.c (ruby_cleanup): use rb_ary_free to free internal object.
* gc.h (RUBY_FREE_UNLESS_NULL): get rid of double free. [ruby-core:35192] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.h')
-rw-r--r--gc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gc.h b/gc.h
index e782ad44c7..df2cf7dd79 100644
--- a/gc.h
+++ b/gc.h
@@ -58,7 +58,7 @@ rb_gc_debug_body(const char *mode, const char *msg, int st, void *ptr)
#endif
#define RUBY_MARK_UNLESS_NULL(ptr) if(RTEST(ptr)){rb_gc_mark(ptr);}
-#define RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);}
+#define RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);(ptr)=NULL;}
#if STACK_GROW_DIRECTION > 0
# define STACK_UPPER(x, a, b) (a)