diff options
Diffstat (limited to 'src/lua/lauxlib.c')
-rw-r--r-- | src/lua/lauxlib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lua/lauxlib.c b/src/lua/lauxlib.c index e3d9be3..cbe9ed3 100644 --- a/src/lua/lauxlib.c +++ b/src/lua/lauxlib.c | |||
@@ -475,8 +475,10 @@ static void *resizebox (lua_State *L, int idx, size_t newsize) { | |||
475 | lua_Alloc allocf = lua_getallocf(L, &ud); | 475 | lua_Alloc allocf = lua_getallocf(L, &ud); |
476 | UBox *box = (UBox *)lua_touserdata(L, idx); | 476 | UBox *box = (UBox *)lua_touserdata(L, idx); |
477 | void *temp = allocf(ud, box->box, box->bsize, newsize); | 477 | void *temp = allocf(ud, box->box, box->bsize, newsize); |
478 | if (temp == NULL && newsize > 0) /* allocation error? */ | 478 | if (temp == NULL && newsize > 0) { /* allocation error? */ |
479 | luaL_error(L, "not enough memory"); | 479 | lua_pushliteral(L, "not enough memory"); |
480 | lua_error(L); /* raise a memory error */ | ||
481 | } | ||
480 | box->box = temp; | 482 | box->box = temp; |
481 | box->bsize = newsize; | 483 | box->bsize = newsize; |
482 | return temp; | 484 | return temp; |