aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lgc.c b/lgc.c
index e3fcaa3e..3884aad0 100644
--- a/lgc.c
+++ b/lgc.c
@@ -813,7 +813,9 @@ static void freeobj (lua_State *L, GCObject *o) {
813 } 813 }
814 case LUA_VLNGSTR: { 814 case LUA_VLNGSTR: {
815 TString *ts = gco2ts(o); 815 TString *ts = gco2ts(o);
816 luaM_freemem(L, ts, sizestrlng(ts->u.lnglen)); 816 if (ts->shrlen == LSTRMEM) /* must free external string? */
817 (*ts->falloc)(ts->ud, ts->contents, ts->u.lnglen + 1, 0);
818 luaM_freemem(L, ts, luaS_sizelngstr(ts->u.lnglen, ts->shrlen));
817 break; 819 break;
818 } 820 }
819 default: lua_assert(0); 821 default: lua_assert(0);