texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/XS/main/parser_conf.c (free_parser_c


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/main/parser_conf.c (free_parser_conf, apply_conf): If the previous conf is not registered, free the list in addition to clearing them as they are overwritten. Found with valgrind.
Date: Wed, 22 May 2024 17:21:56 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new f749012fbe * tp/Texinfo/XS/main/parser_conf.c (free_parser_conf, 
apply_conf): If the previous conf is not registered, free the list in addition 
to clearing them as they are overwritten.  Found with valgrind.
f749012fbe is described below

commit f749012fbe9cb1012fd8776d567fb89d8ea2418a
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed May 22 23:21:46 2024 +0200

    * tp/Texinfo/XS/main/parser_conf.c (free_parser_conf, apply_conf):
    If the previous conf is not registered, free the list in addition to
    clearing them as they are overwritten.  Found with valgrind.
---
 ChangeLog                        |  6 ++++++
 tp/Texinfo/XS/main/parser_conf.c | 11 ++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index f5b0a4a1fb..d71d81c06a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-05-22  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/main/parser_conf.c (free_parser_conf, apply_conf):
+       If the previous conf is not registered, free the list in addition to
+       clearing them as they are overwritten.  Found with valgrind.
+
 2024-05-22  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/main/translations.c (replace_convert_substrings): call
diff --git a/tp/Texinfo/XS/main/parser_conf.c b/tp/Texinfo/XS/main/parser_conf.c
index 462e182de0..f0b8e7ddb4 100644
--- a/tp/Texinfo/XS/main/parser_conf.c
+++ b/tp/Texinfo/XS/main/parser_conf.c
@@ -91,10 +91,19 @@ clear_parser_conf (PARSER_CONF *parser_conf)
   free (parser_conf->locale_encoding);
 }
 
+static void
+free_parser_conf (PARSER_CONF *parser_conf)
+{
+  clear_parser_conf (parser_conf);
+  free_strings_list (&parser_conf->include_directories);
+  free (parser_conf->values.list);
+}
+
 void
 apply_conf (PARSER_CONF *parser_conf)
 {
   if (!global_parser_conf.descriptor)
-    clear_parser_conf (&global_parser_conf);
+   /* the lists are overwritten, so they need to be freed, not only cleared */
+    free_parser_conf (&global_parser_conf);
   global_parser_conf = *parser_conf;
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]