diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-09-03 08:34:31 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-09-03 08:34:31 +0900 |
| commit | 4f7a1a167db8a3373b356540eaee21f9cf93e7f2 (patch) | |
| tree | ecb3153837939d66d675f08cb67babdd2c83c392 /src/proc.c | |
| parent | 5340126443609265d63159e4c391049cb722f828 (diff) | |
| download | mruby-4f7a1a167db8a3373b356540eaee21f9cf93e7f2.tar.gz mruby-4f7a1a167db8a3373b356540eaee21f9cf93e7f2.zip | |
remove memleaks using linked allocator
Diffstat (limited to 'src/proc.c')
| -rw-r--r-- | src/proc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/proc.c b/src/proc.c index 44c712a95..0efc8d286 100644 --- a/src/proc.c +++ b/src/proc.c @@ -144,12 +144,13 @@ void mrb_init_proc(mrb_state *mrb) { struct RProc *m; - mrb_code *call_iseq = (mrb_code *)mrb_malloc(mrb, sizeof(mrb_code)); - mrb_irep *call_irep = (mrb_irep *)mrb_calloc(mrb, sizeof(mrb_irep), 1); + mrb_code *call_iseq = (mrb_code *)mrb_alloca(mrb, sizeof(mrb_code)); + mrb_irep *call_irep = (mrb_irep *)mrb_alloca(mrb, sizeof(mrb_irep)); if ( call_iseq == NULL || call_irep == NULL ) return; + memset(call_irep, 0, sizeof(mrb_irep)); *call_iseq = MKOP_A(OP_CALL, 0); call_irep->idx = -1; call_irep->iseq = call_iseq; |
