mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-20 05:53:26 +00:00
Actually free malloc'ed memory
This commit is contained in:
parent
becf5cc65d
commit
89ef1759ab
@ -10,7 +10,7 @@
|
||||
** _building_ LuaJIT. There's no point in distributing or installing it.
|
||||
** Only the object code generated by this tool is linked into LuaJIT.
|
||||
**
|
||||
** Caveat: some memory is not free'd, error handling is lazy.
|
||||
** Caveat: error handling is lazy.
|
||||
** It's a one-shot tool -- any effort fixing this would be wasted.
|
||||
*/
|
||||
|
||||
@ -524,6 +524,20 @@ int main(int argc, char **argv)
|
||||
}
|
||||
fclose(ctx->fp);
|
||||
|
||||
// cleanup
|
||||
free(ctx->code);
|
||||
free(ctx->glob);
|
||||
for(int i=0; i<=ctx->nsym; i++) {
|
||||
free((void*)ctx->sym[i].name);
|
||||
}
|
||||
free(ctx->sym);
|
||||
for(int i=0; i<ctx->nrelocsym; i++) {
|
||||
free((void*)ctx->relocsym[i]);
|
||||
}
|
||||
free(ctx->relocsym);
|
||||
free(ctx->bc_ofs);
|
||||
free((void*)ctx->beginsym);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user