texlive[72753] Build/source/texk/web2c/luatexdir: Fixed a memory leak

commits+lscarso at tug.org commits+lscarso at tug.org
Sun Nov 3 13:38:33 CET 2024


Revision: 72753
          https://tug.org/svn/texlive?view=revision&revision=72753
Author:   lscarso
Date:     2024-11-03 13:38:32 +0100 (Sun, 03 Nov 2024)
Log Message:
-----------
Fixed a memory leak in token.put_next() and token.set_macro() (thanks to user202729 at protonmail.com)

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/luatexdir/ChangeLog
    trunk/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c
    trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h

Modified: trunk/Build/source/texk/web2c/luatexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/ChangeLog	2024-11-03 00:46:38 UTC (rev 72752)
+++ trunk/Build/source/texk/web2c/luatexdir/ChangeLog	2024-11-03 12:38:32 UTC (rev 72753)
@@ -1,3 +1,8 @@
+2024-11-02  Luigi Scarso <luigi.scarso at gmail.com>
+	* Fixed a memory leak in token.put_next()  (thanks to user202729 at protonmail.com)
+	* Fixed a memory leak in token.set_macro() implementation (thanks to user202729 at protonmail.com)
+
+
 2024-10-12  Luigi Scarso <luigi.scarso at gmail.com>
 	* Handle token combiners in immediate assignments (H.Hagen)
 	* LuaTeX 1.19.0

Modified: trunk/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c	2024-11-03 00:46:38 UTC (rev 72752)
+++ trunk/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c	2024-11-03 12:38:32 UTC (rev 72753)
@@ -330,7 +330,7 @@
     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 @@
         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 @@
         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));
     }

Modified: trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h	2024-11-03 00:46:38 UTC (rev 72752)
+++ trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h	2024-11-03 12:38:32 UTC (rev 72753)
@@ -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



More information about the tex-live-commits mailing list.