Commit a4f63caa authored by Blaž Hrastnik's avatar Blaž Hrastnik

Fix incorrect memory allocation of mrdb_state_new.

As detected in a Coverity scan. https://scan8.coverity.com/reports.htm#v26153/p11375/fileInstanceId=6844472&defectInstanceId=2516000&mergedDefectId=75866
parent ff49cf95
...@@ -222,9 +222,9 @@ mrb_debug_context_free(mrb_state *mrb) ...@@ -222,9 +222,9 @@ mrb_debug_context_free(mrb_state *mrb)
static mrdb_state* static mrdb_state*
mrdb_state_new(mrb_state *mrb) mrdb_state_new(mrb_state *mrb)
{ {
mrdb_state *mrdb = mrb_malloc(mrb, sizeof(mrb_state)); mrdb_state *mrdb = mrb_malloc(mrb, sizeof(mrdb_state));
memset(mrdb, 0, sizeof(mrb_state)); memset(mrdb, 0, sizeof(mrdb_state));
mrdb->dbg = mrb_debug_context_get(mrb); mrdb->dbg = mrb_debug_context_get(mrb);
mrdb->command = mrb_malloc(mrb, MAX_COMMAND_LINE+1); mrdb->command = mrb_malloc(mrb, MAX_COMMAND_LINE+1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment