diff options
| author | Tatsuhiko Kubo <[email protected]> | 2014-08-26 08:42:43 +0900 |
|---|---|---|
| committer | Tatsuhiko Kubo <[email protected]> | 2014-08-27 18:58:26 +0900 |
| commit | bf173b320f21573ff3400eca950b4374661895a6 (patch) | |
| tree | f94c6639e515213d35f26b873cb905a6eaa425c5 | |
| parent | ecda19f4024cd853d933b059ba9f082a42837096 (diff) | |
| download | mruby-bf173b320f21573ff3400eca950b4374661895a6.tar.gz mruby-bf173b320f21573ff3400eca950b4374661895a6.zip | |
Remove discareded NULL checks.
| -rw-r--r-- | src/dump.c | 3 | ||||
| -rw-r--r-- | src/gc.c | 4 |
2 files changed, 1 insertions, 6 deletions
diff --git a/src/dump.c b/src/dump.c index e019baa99..e67eabbc8 100644 --- a/src/dump.c +++ b/src/dump.c @@ -889,9 +889,6 @@ mrb_dump_irep(mrb_state *mrb, mrb_irep *irep, int debug_info, uint8_t **bin, siz section_irep_size + section_lineno_size + section_lv_size + sizeof(struct rite_binary_footer); cur = *bin = (uint8_t*)mrb_malloc(mrb, *bin_size); - if (cur == NULL) { - goto error_exit; - } cur += sizeof(struct rite_binary_header); result = write_section_irep(mrb, irep, cur); @@ -229,9 +229,7 @@ mrb_calloc(mrb_state *mrb, size_t nelem, size_t len) size = nelem * len; p = mrb_realloc(mrb, 0, size); - if (p) { - memset(p, 0, size); - } + memset(p, 0, size); } else { p = NULL; |
