diff --git a/lib/heap/heap_wrapper.c b/lib/heap/heap_wrapper.c index 2764f4265..ec3aeb305 100644 --- a/lib/heap/heap_wrapper.c +++ b/lib/heap/heap_wrapper.c @@ -340,7 +340,7 @@ static int cmd_heap(int argc, const console_cmd_args *argv) { void *ptr = realloc(argv[2].p, argv[3].u); printf("realloc returns %p\n", ptr); } else if (strcmp(argv[1].str, "free") == 0) { - if (argc < 2) goto notenoughargs; + if (argc < 3) goto notenoughargs; free(argv[2].p); } else {