diff options
Diffstat (limited to 'lauxlib.c')
-rw-r--r-- | lauxlib.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; |