Skip to content

Commit

Permalink
Fixed a memory leak in token.put_next() and token.set_macro() (thanks…
Browse files Browse the repository at this point in the history
… to [email protected])

git-svn-id: svn://tug.org/texlive/trunk/Build/source@72753 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
luigiScarso committed Nov 3, 2024
1 parent bb8920b commit c31644c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions texk/web2c/luatexdir/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2024-11-02 Luigi Scarso <[email protected]>
* Fixed a memory leak in token.put_next() (thanks to [email protected])
* Fixed a memory leak in token.set_macro() implementation (thanks to [email protected])


2024-10-12 Luigi Scarso <[email protected]>
* Handle token combiners in immediate assignments (H.Hagen)
* LuaTeX 1.19.0
Expand Down
10 changes: 5 additions & 5 deletions texk/web2c/luatexdir/lua/lnewtokenlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) */
Expand Down Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion texk/web2c/luatexdir/luatex_svnversion.h
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c31644c

Please sign in to comment.