Skip to content

Commit

Permalink
Fixing CLIB's API usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasnoble committed Jun 6, 2023
1 parent 362ff93 commit 66fadd1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lj_clib.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,10 @@ void lj_clib_load(lua_State *L, GCtab *mt, GCstr *name, int global)
/* Unload a C library. */
void lj_clib_unload(lua_State *L, CLibrary *cl)
{
cl->name = lj_mem_realloc(L, cl->name, 0, 0);
cl->name = NULL;
if (cl->name) {
cl->name = lj_mem_realloc(L, cl->name, strlen(cl->name) + 1, 0);
cl->name = NULL;
}
clib_unloadlib(cl);
cl->handle = NULL;
}
Expand Down

0 comments on commit 66fadd1

Please sign in to comment.