diff options
author | Luigi Scarso <luigi.scarso@gmail.com> | 2024-11-03 12:38:32 +0000 |
---|---|---|
committer | Luigi Scarso <luigi.scarso@gmail.com> | 2024-11-03 12:38:32 +0000 |
commit | 5ada46b1fa1645a2886776bca74240f71605c44a (patch) | |
tree | 64e781a6b695cd04e2017b5b7a036585e5acc44f /Build/source/texk/web2c/luatexdir | |
parent | 005f20c3511a1563ddb8d31a5f39e3bdb8394f5a (diff) |
Fixed a memory leak in token.put_next() and token.set_macro() (thanks to user202729@protonmail.com)
git-svn-id: svn://tug.org/texlive/trunk@72753 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c | 10 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/luatex_svnversion.h | 2 |
3 files changed, 11 insertions, 6 deletions
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog index 5e519d98d61..34a147313f7 100644 --- a/Build/source/texk/web2c/luatexdir/ChangeLog +++ b/Build/source/texk/web2c/luatexdir/ChangeLog @@ -1,3 +1,8 @@ +2024-11-02 Luigi Scarso <luigi.scarso@gmail.com> + * Fixed a memory leak in token.put_next() (thanks to user202729@protonmail.com) + * Fixed a memory leak in token.set_macro() implementation (thanks to user202729@protonmail.com) + + 2024-10-12 Luigi Scarso <luigi.scarso@gmail.com> * Handle token combiners in immediate assignments (H.Hagen) * LuaTeX 1.19.0 diff --git a/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c b/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c index 7c81e462e84..984e5094335 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c @@ -330,7 +330,7 @@ inline static int run_put_next(lua_State * L) if (h == null) { /* can't happen */ } else { - begin_token_list(h,0); + begin_token_list(h,4); } lua_settop(L,n); return 0; @@ -1265,9 +1265,9 @@ static int set_macro(lua_State * L) const char *se = str + lstr; p = temp_token_head; set_token_link(p, null); - /* this left brace is used to store the number of arguments */ - fast_store_new_token(left_brace_token); - /* and this ends the not present arguments, and no: we will not support arguments here*/ + /* reference count */ + fast_store_new_token(0); + /* this ends the not present arguments, and no: we will not support arguments here*/ fast_store_new_token(end_match_token); while (str < se) { /* hh: str2uni could return len too (also elsewhere) */ @@ -1334,7 +1334,7 @@ static int set_macro(lua_State * L) halfword q; /* new node being added to the token list via |store_new_token| */ p = temp_token_head; set_token_info(p,null); - fast_store_new_token(left_brace_token); + fast_store_new_token(0); fast_store_new_token(end_match_token); define(cs, call_cmd + (a % 4), token_link(temp_token_head)); } diff --git a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h index 2a64a438cb3..1216908b078 100644 --- a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h +++ b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h @@ -1,4 +1,4 @@ #ifndef luatex_svn_revision_h #define luatex_svn_revision_h -#define luatex_svn_revision 7627 +#define luatex_svn_revision 7628 #endif |