mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add NULL check in sg_compact(); fix #4139
This commit is contained in:
+3
-1
@@ -226,12 +226,14 @@ sg_index(mrb_state *mrb, seglist *t)
|
||||
static void
|
||||
sg_compact(mrb_state *mrb, seglist *t)
|
||||
{
|
||||
segment *seg = t->rootseg;
|
||||
segment *seg;
|
||||
mrb_int i;
|
||||
segment *seg2 = NULL;
|
||||
mrb_int i2;
|
||||
mrb_int size = 0;
|
||||
|
||||
if (t == NULL) return;
|
||||
seg = t->rootseg;
|
||||
if (t->index && (size_t)t->size == t->index->size) {
|
||||
sg_index(mrb, t);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user