diff options
| author | Blaž Hrastnik <[email protected]> | 2015-07-02 20:47:22 +0200 |
|---|---|---|
| committer | Blaž Hrastnik <[email protected]> | 2015-07-02 20:47:22 +0200 |
| commit | a4f63caa7947c049ad310e9e5016404b377ebe6e (patch) | |
| tree | 78db24bbb04d80a08b37ad6f80b8c880d2883571 | |
| parent | ff49cf95fca2d1648f05dd636c8f8516c8edc815 (diff) | |
| download | mruby-a4f63caa7947c049ad310e9e5016404b377ebe6e.tar.gz mruby-a4f63caa7947c049ad310e9e5016404b377ebe6e.zip | |
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
| -rwxr-xr-x | mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c b/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c index da235fad8..3e43fdb4a 100755 --- a/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +++ b/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c @@ -222,9 +222,9 @@ mrb_debug_context_free(mrb_state *mrb) static mrdb_state* 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->command = mrb_malloc(mrb, MAX_COMMAND_LINE+1); |
