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/ConvertXS.xs, tp/Texinfo/


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/convert/ConvertXS.xs, tp/Texinfo/XS/convert/build_html_perl_info.c, tp/Texinfo/XS/main/get_perl_info.c: use non_perl_free instead of free to free variables allocated outside of Perl C code.
Date: Sun, 08 Dec 2024 11:12:54 -0500

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 24bb1aa549 * tp/Texinfo/XS/convert/ConvertXS.xs, 
tp/Texinfo/XS/convert/build_html_perl_info.c, 
tp/Texinfo/XS/main/get_perl_info.c: use non_perl_free instead of free to free 
variables allocated outside of Perl C code.
24bb1aa549 is described below

commit 24bb1aa549c3393faf9c21a712ddfb343a788f31
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Dec 8 17:12:45 2024 +0100

    * tp/Texinfo/XS/convert/ConvertXS.xs,
    tp/Texinfo/XS/convert/build_html_perl_info.c,
    tp/Texinfo/XS/main/get_perl_info.c: use non_perl_free instead of free
    to free variables allocated outside of Perl C code.
---
 ChangeLog                                    |  7 ++++++
 tp/Texinfo/XS/convert/ConvertXS.xs           | 32 ++++++++++++++--------------
 tp/Texinfo/XS/convert/build_html_perl_info.c |  4 +++-
 tp/Texinfo/XS/main/get_perl_info.c           |  8 +++----
 4 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 390e1bc33e..806c0cb66c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-12-08  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/convert/ConvertXS.xs,
+       tp/Texinfo/XS/convert/build_html_perl_info.c,
+       tp/Texinfo/XS/main/get_perl_info.c: use non_perl_free instead of free
+       to free variables allocated outside of Perl C code.
+
 2024-12-08  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/main/build_perl_info.c (build_perl_array)
diff --git a/tp/Texinfo/XS/convert/ConvertXS.xs 
b/tp/Texinfo/XS/convert/ConvertXS.xs
index fc7b4ab00d..eca8e635da 100644
--- a/tp/Texinfo/XS/convert/ConvertXS.xs
+++ b/tp/Texinfo/XS/convert/ConvertXS.xs
@@ -850,7 +850,7 @@ html_setup_output (SV *converter_in)
 
                 for (i = 0; i < 5; i++)
                   {
-                    free (paths[i]);
+                    non_perl_free (paths[i]);
                   }
               }
 
@@ -1013,7 +1013,7 @@ html_convert_convert (SV *converter_in, ...)
         result = html_convert_convert (self, self->document->tree);
         build_html_formatting_state (self);
         RETVAL = newSVpv_utf8 (result, 0);
-        free (result);
+        non_perl_free (result);
     OUTPUT:
         RETVAL
 
@@ -1041,7 +1041,7 @@ html_convert_output (SV *converter_in, output_file, 
destination_directory, outpu
             if (result)
               {
                 result_sv = newSVpv_utf8 (result, 0);
-                free (result);
+                non_perl_free (result);
               }
 
             build_output_files_information (converter_in,
@@ -1075,7 +1075,7 @@ html_prepare_node_redirection_page (SV *converter_in, SV 
*element_sv, redirectio
         if (redirection_page)
           {
             RETVAL = newSVpv_utf8 (redirection_page, 0);
-            free (redirection_page);
+            non_perl_free (redirection_page);
           }
         else
           RETVAL = newSV (0);
@@ -1207,7 +1207,7 @@ html_output (SV *converter_in, SV *document_in)
           }
 
         /* output to a file only */
-        free (result);
+        non_perl_free (result);
         result = 0;
 
         status = html_finish_output (self, output_file, destination_directory);
@@ -1215,7 +1215,7 @@ html_output (SV *converter_in, SV *document_in)
       finalization:
         for (i = 0; i < 5; i++)
           {
-            free (paths[i]);
+            non_perl_free (paths[i]);
           }
         /* html_conversion_finalization */
         html_conversion_finalization (self);
@@ -1225,7 +1225,7 @@ html_output (SV *converter_in, SV *document_in)
         if (result)
           {
             RETVAL = newSVpv_utf8 (result, 0);
-            free (result);
+            non_perl_free (result);
           }
         else
           RETVAL = newSV (0);
@@ -1311,7 +1311,7 @@ html_convert (SV *converter_in, SV *document_in)
         html_check_transfer_state_finalization (self);
 
         RETVAL = newSVpv_utf8 (result, 0);
-        free (result);
+        non_perl_free (result);
     OUTPUT:
         RETVAL
 
@@ -2411,7 +2411,7 @@ html_attribute_class (SV *converter_in, element, ...)
             if (classes)
               destroy_strings_list (classes);
             RETVAL = newSVpv_utf8 (result, 0);
-            free (result);
+            non_perl_free (result);
           }
         else
           RETVAL = newSV (0);
@@ -2644,7 +2644,7 @@ html_cancel_pending_formatted_inline_content (SV 
*converter_in, category)
         if (inline_content)
           {
             RETVAL = newSVpv_utf8 (inline_content, 0);
-            free (inline_content);
+            non_perl_free (inline_content);
           }
         else
           RETVAL = newSV (0);
@@ -2666,7 +2666,7 @@ html_get_pending_formatted_inline_content (SV 
*converter_in)
         if (inline_content)
           {
             RETVAL = newSVpv_utf8 (inline_content, 0);
-            free (inline_content);
+            non_perl_free (inline_content);
           }
         else
           RETVAL = newSV (0);
@@ -2700,7 +2700,7 @@ html_get_associated_formatted_inline_content (SV 
*converter_in, SV *element_sv)
              = html_get_associated_formatted_inline_content (self,
                                                   0, SvRV (element_sv));
             RETVAL = newSVpv_utf8 (inline_content, 0);
-            free (inline_content);
+            non_perl_free (inline_content);
           }
         else
           RETVAL = newSV (0);
@@ -2771,9 +2771,9 @@ html_check_htmlxref_already_warned (SV *converter_in, 
manual_name, SV *source_in
                                                      source_info);
         if (source_info)
           {
-            free (source_info->macro);
-            free (source_info->file_name);
-            free (source_info);
+            non_perl_free (source_info->macro);
+            non_perl_free (source_info->file_name);
+            non_perl_free (source_info);
           }
     OUTPUT:
         RETVAL
@@ -2800,7 +2800,7 @@ html_convert_tree (SV *converter_in, SV *tree_in, 
explanation)
                 char *result = html_convert_tree(self, document->tree,
                                                  explanation);
                 result_sv = newSVpv_utf8 (result, 0);
-                free (result);
+                non_perl_free (result);
               }
           }
         if (result_sv)
diff --git a/tp/Texinfo/XS/convert/build_html_perl_info.c 
b/tp/Texinfo/XS/convert/build_html_perl_info.c
index 9270ff5c77..aa7ca93ec6 100644
--- a/tp/Texinfo/XS/convert/build_html_perl_info.c
+++ b/tp/Texinfo/XS/convert/build_html_perl_info.c
@@ -31,6 +31,8 @@
 #include "converter_types.h"
 /* bug */
 #include "base_utils.h"
+/* non_perl_free */
+#include "xs_utils.h"
 /* for builtin_command_name */
 #include "builtin_commands.h"
 /* for HMSF_* */
@@ -872,7 +874,7 @@ pass_sv_converter_info (const CONVERTER *converter,
       xasprintf (&bug_msg, "%s not an available converter info",
                  converter_info);
       bug (bug_msg);
-      free (bug_msg);
+      non_perl_free (bug_msg);
     }
 
   if (new_sv)
diff --git a/tp/Texinfo/XS/main/get_perl_info.c 
b/tp/Texinfo/XS/main/get_perl_info.c
index 6c6be49a18..457f1b7f1e 100644
--- a/tp/Texinfo/XS/main/get_perl_info.c
+++ b/tp/Texinfo/XS/main/get_perl_info.c
@@ -54,8 +54,6 @@
 #define FETCH(key) key##_sv = hv_fetch (element_hv, #key, strlen (#key), 0);
 
 /* used for debugging only */
-/* This function mixes Perl and gnulib allocation functions, but since it is
-   only used for debugging it is ok */
 static void
 debug_print_element_hv (HV *element_hv)
 {
@@ -85,10 +83,10 @@ debug_print_element_hv (HV *element_hv)
       char *text = SvPVutf8_nolen (*text_sv);
       char *protected_text = debug_protect_eol (text);
       text_printf (&msg, "[T: %s]", protected_text);
-      free (protected_text);
+      non_perl_free (protected_text);
     }
   fprintf (stderr, "ELT_sv: %s\n", msg.text);
-  free (msg.text);
+  non_perl_free (msg.text);
 }
 
 /* used for debugging only */
@@ -552,7 +550,7 @@ init_copy_sv_options (SV *sv_in, CONVERTER *converter, int 
force,
   if (sorted_options_out)
     *sorted_options_out = sorted_options;
   else
-    free (sorted_options);
+    non_perl_free (sorted_options);
   return options;
 }
 



reply via email to

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