我正在运行splint
一段 C 代码,它给了我以下语句:
jmptable.c:34:5: Implicitly only storage vm->jumptable (type struct
jumptable_entry **) not released before assignment:
vm->jumptable = (struct jumptable_entry **)calloc(vm->jumptable_size + 1,
sizeof(struct jumptable_entry *))
A memory leak has been detected. Only-qualified storage is not released
before the last reference to it is lost. (Use -mustfreeonly to inhibit
warning)
我知道夹板free
在分配内存之前希望我使用它,calloc
但由于这是在应用程序的初始化过程中,我应该担心它吗?
编辑:这就是 vm->jumptable 的初始化方式
vm->jumptable = (struct jumptable_entry**) calloc(vm->jumptable_size + 1,
sizeof(struct jumptable_entry*));