aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lauxlib.c')
-rw-r--r--lauxlib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lauxlib.c b/lauxlib.c
index e3d9be37..cbe9ed31 100644
--- a/lauxlib.c
+++ b/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;