From 606095f2fe955f61aea88cd2e7ed9a6387eecaac Mon Sep 17 00:00:00 2001 From: Tatsuhiko Kubo Date: Thu, 1 Jan 2015 05:12:41 +0900 Subject: Remove redundant NULL checks for mrb_malloc(). --- mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c') diff --git a/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c b/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c index f1bf34a06..610a5db6f 100755 --- a/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c +++ b/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c @@ -203,9 +203,6 @@ mrb_debug_set_break_line( mrb_state *mrb, mrb_debug_context *dbg, const char *fi } set_file = mrb_malloc(mrb, strlen(file) + 1); - if(set_file == NULL) { - return MRB_DEBUG_NOBUF; - } index = dbg->bpnum; dbg->bp[index].bpno = dbg->next_bpno; @@ -243,10 +240,6 @@ mrb_debug_set_break_method( mrb_state *mrb, mrb_debug_context *dbg, const char * if(class_name != NULL) { set_class = mrb_malloc(mrb, strlen(class_name) + 1); - if(set_class == NULL) { - return MRB_DEBUG_NOBUF; - } - strncpy(set_class, class_name, strlen(class_name) + 1); } else { @@ -254,12 +247,6 @@ mrb_debug_set_break_method( mrb_state *mrb, mrb_debug_context *dbg, const char * } set_method = mrb_malloc(mrb, strlen(method_name) + 1); - if(set_method == NULL) { - if(set_class != NULL) { - mrb_free(mrb, (void*)set_class); - } - return MRB_DEBUG_NOBUF; - } strncpy(set_method, method_name, strlen(method_name) + 1); -- cgit v1.2.3