Remove redundant null checks.

This commit is contained in:
Masaki Muranaka
2013-01-09 11:22:39 +09:00
parent b5830aed17
commit 94fb04a51e
3 changed files with 6 additions and 12 deletions
+1 -2
View File
@@ -167,8 +167,7 @@ make_cdump_irep(mrb_state *mrb, int irep_no, FILE *f)
else
SOURCE_CODE0("");
if (buf)
mrb_free(mrb, buf);
mrb_free(mrb, buf);
return MRB_CDUMP_OK;
}
+2 -4
View File
@@ -409,8 +409,7 @@ write_pool_block(mrb_state *mrb, mrb_irep *irep, char *buf, int type)
}
error_exit:
if (char_buf)
mrb_free(mrb, char_buf);
mrb_free(mrb, char_buf);
return (int)(buf - buf_top);
}
@@ -455,8 +454,7 @@ write_syms_block(mrb_state *mrb, mrb_irep *irep, char *buf, int type)
}
error_exit:
if (char_buf)
mrb_free(mrb, char_buf);
mrb_free(mrb, char_buf);
return (int)(buf - buf_top);
}
+3 -6
View File
@@ -235,8 +235,7 @@ load_rite_irep_record(mrb_state *mrb, RiteFILE* rfp, unsigned char* dst, uint32_
*len = dst - pStart;
error_exit:
if (char_buf)
mrb_free(mrb, char_buf);
mrb_free(mrb, char_buf);
return MRB_DUMP_OK;
}
@@ -292,8 +291,7 @@ mrb_read_irep_file(mrb_state *mrb, FILE* fp)
ret = mrb_read_irep(mrb, (char*)rite_dst);
error_exit:
if (rite_dst)
mrb_free(mrb, rite_dst);
mrb_free(mrb, rite_dst);
return ret;
}
@@ -489,8 +487,7 @@ read_rite_irep_record(mrb_state *mrb, unsigned char *src, uint32_t* len)
*len = src - recordStart;
error_exit:
if (buf)
mrb_free(mrb, buf);
mrb_free(mrb, buf);
return ret;
}