texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/XS/convert/convert_html.c (reset_uns


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/convert/convert_html.c (reset_unset_no_arg_commands_formatting_context): free no_arg_command_context->text be fore resetting.
Date: Fri, 20 Oct 2023 15:41:08 -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 cb83f5a903 * tp/Texinfo/XS/convert/convert_html.c 
(reset_unset_no_arg_commands_formatting_context): free 
no_arg_command_context->text be fore resetting.
cb83f5a903 is described below

commit cb83f5a9031c7920efe682667a21549dcf197baf
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Oct 20 21:40:45 2023 +0200

    * tp/Texinfo/XS/convert/convert_html.c
    (reset_unset_no_arg_commands_formatting_context): free
    no_arg_command_context->text be fore resetting.
    
    * tp/Texinfo/XS/convert/convert_html.c (translate_names)
    (prepare_index_entries_targets): free lists and normalized_index.
    
    * tp/Texinfo/XS/convert/converter.c (set_global_document_commands):
    free option_ref char before resetting.
---
 ChangeLog                            | 12 ++++++++++++
 tp/Texinfo/XS/convert/convert_html.c |  8 +++++++-
 tp/Texinfo/XS/convert/converter.c    | 11 ++++++++---
 3 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6a9620ddc4..b71b412bc5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,18 @@
        Texinfo::Convert::ParagraphNonXS::add_text doesn't set
        $paragraph->{'last_letter'}.
 
+2023-10-19  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/convert/convert_html.c
+       (reset_unset_no_arg_commands_formatting_context): free
+       no_arg_command_context->text be fore resetting.
+
+       * tp/Texinfo/XS/convert/convert_html.c (translate_names)
+       (prepare_index_entries_targets): free lists and normalized_index.
+
+       * tp/Texinfo/XS/convert/converter.c (set_global_document_commands):
+       free option_ref char before resetting.
+
 2023-10-19  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Makefile.am (Texinfo/Commands.pm, Texinfo/Options.pm),
diff --git a/tp/Texinfo/XS/convert/convert_html.c 
b/tp/Texinfo/XS/convert/convert_html.c
index 3455d61a64..5f3f193dc3 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -274,6 +274,8 @@ reset_unset_no_arg_commands_formatting_context (CONVERTER 
*self,
           translation_result = html_convert_css_string (self, translated_tree);
             */
         }
+      if (no_arg_command_context->text)
+        free (no_arg_command_context->text);
       no_arg_command_context->text = translation_result;
     }
 }
@@ -405,6 +407,8 @@ translate_names (CONVERTER *self)
           enum command_id cmd = translated_cmds[j];
           complete_no_arg_commands_formatting (self, cmd, 1);
         }
+
+      free (translated_cmds);
     }
 
   if (self->conf->DEBUG > 0)
@@ -1392,7 +1396,7 @@ prepare_index_entries_targets (CONVERTER *self)
                   ELEMENT *subentries_tree;
                   ELEMENT *target_element;
                   TEXT target_base;
-                  char *normalized_index = "";
+                  char *normalized_index;
                   char *region = 0;
                   char *target;
 
@@ -1438,6 +1442,7 @@ prepare_index_entries_targets (CONVERTER *self)
                       text_append (&target_base, "-");
                     }
                   text_append (&target_base, normalized_index);
+                  free (normalized_index);
                   target = unique_target (self, target_base.text);
                   free (target_base.text);
                   if (index_entry->entry_associated_element)
@@ -1450,6 +1455,7 @@ prepare_index_entries_targets (CONVERTER *self)
                 }
             }
         }
+      free (sorted_index_names);
     }
 }
 
diff --git a/tp/Texinfo/XS/convert/converter.c 
b/tp/Texinfo/XS/convert/converter.c
index 354e3dd618..cec0452c61 100644
--- a/tp/Texinfo/XS/convert/converter.c
+++ b/tp/Texinfo/XS/convert/converter.c
@@ -170,8 +170,10 @@ set_global_document_commands (CONVERTER *converter,
               if (option_value->type == GO_int)
                 *(option_ref->int_ref) = option_value->int_value;
               else
-                *(option_ref->char_ref) = option_value->char_value;
-
+                {
+                  free (*(option_ref->char_ref));
+                  *(option_ref->char_ref) = option_value->char_value;
+                }
               free (option_ref);
               free (option_value);
             }
@@ -202,7 +204,10 @@ set_global_document_commands (CONVERTER *converter,
                   if (option_value->type == GO_int)
                     *(option_ref->int_ref) = option_value->int_value;
                   else
-                    *(option_ref->char_ref) = option_value->char_value;
+                    {
+                      free (*(option_ref->char_ref));
+                      *(option_ref->char_ref) = option_value->char_value;
+                    }
 
                   free (option_ref);
                   free (option_value);



reply via email to

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