From f20a86e494226144d9b722daac480f3b1c19d650 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 11 Jan 2014 20:36:48 +0000 Subject: [PATCH] iseq: avoid potential memory leak in iseq_load I am not sure how to trigger this, but the type_map table is on stack and never freed. Based on how it's populated, it looks like it was intended to be a static table. --- iseq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iseq.c b/iseq.c index a829089..5fda69c 100644 --- a/iseq.c +++ b/iseq.c @@ -483,7 +483,7 @@ iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt) VALUE type, body, locals, args, exception; st_data_t iseq_type; - struct st_table *type_map = 0; + static struct st_table *type_map; rb_iseq_t *iseq; rb_compile_option_t option; int i = 0; -- 1.8.5.2.193.g2394e94