diff --git a/lua/lauxlib.c b/lua/lauxlib.c index 08d4f4c..b66e06f 100644 --- a/lua/lauxlib.c +++ b/lua/lauxlib.c @@ -988,7 +988,7 @@ LUALIB_API const char *luaL_gsub (lua_State *L, const char *s, static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { (void)ud; (void)osize; /* not used */ if (nsize == 0) { - RD_FREE(ptr); + if (ptr) RD_FREE(ptr); return NULL; } else