[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Fix memory leaks found with valgrind
From: |
Patrice Dumas |
Subject: |
branch master updated: Fix memory leaks found with valgrind |
Date: |
Tue, 20 Feb 2024 16:55:28 -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 6ac6e464b3 Fix memory leaks found with valgrind
6ac6e464b3 is described below
commit 6ac6e464b3622449cf203b9065dc81338a70240c
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Feb 20 22:53:19 2024 +0100
Fix memory leaks found with valgrind
* tp/Texinfo/XS/parsetexi/end_line.c (end_line_misc_line): free
fullpath of verbatiminclude after adding to global_info included_files.
* tp/Texinfo/XS/convert/convert_html.c (mini_toc_internal): set href
after it is sure that the section is non empty and processed.
---
ChangeLog | 10 ++++++++++
tp/Texinfo/XS/convert/convert_html.c | 4 +++-
tp/Texinfo/XS/parsetexi/end_line.c | 1 +
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 6ed22359e9..6ee627e08d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-02-20 Patrice Dumas <pertusus@free.fr>
+
+ Fix memory leaks found with valgrind
+
+ * tp/Texinfo/XS/parsetexi/end_line.c (end_line_misc_line): free
+ fullpath of verbatiminclude after adding to global_info included_files.
+
+ * tp/Texinfo/XS/convert/convert_html.c (mini_toc_internal): set href
+ after it is sure that the section is non empty and processed.
+
2024-02-20 Gavin Smith <gavinsmith0123@gmail.com>
* tp/Texinfo/XS:
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index ac3a57c6b2..dbbae01cab 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -9799,12 +9799,14 @@ mini_toc_internal (CONVERTER *self, const ELEMENT
*element, TEXT *result)
char *explanation;
char *accesskey;
char *text;
- char *href = html_command_href (self, section, 0, 0, 0);
+ char *href;
/* happens with empty sectioning command */
if (!command_tree->tree)
continue;
+ href = html_command_href (self, section, 0, 0, 0);
+
xasprintf (&explanation, "mini_toc @%s",
element_command_name (section));
text = html_convert_tree (self, command_tree->tree, explanation);
diff --git a/tp/Texinfo/XS/parsetexi/end_line.c
b/tp/Texinfo/XS/parsetexi/end_line.c
index 5f8fb2b6b6..051a2dc1ac 100644
--- a/tp/Texinfo/XS/parsetexi/end_line.c
+++ b/tp/Texinfo/XS/parsetexi/end_line.c
@@ -1328,6 +1328,7 @@ end_line_misc_line (ELEMENT *current)
fullpath = parser_locate_include_file (sys_filename);
if (fullpath && access (fullpath, R_OK) == 0)
add_string (fullpath, &global_info.included_files);
+ free (fullpath);
}
else if (current->cmd == CM_documentencoding)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Fix memory leaks found with valgrind,
Patrice Dumas <=
- Prev by Date:
branch master updated: untrack iconv_open-*.h
- Next by Date:
branch master updated: * tp/Texinfo/Convert/Converter.pm (output), tp/Texinfo/Convert/HTML.pm (_internal_command_href, _html_get_tree_root_element) (_html_set_pages_files, _prepare_special_units, _html_convert_convert) (output_internal_links, _html_convert_output), tp/Texinfo/Convert/IXIN.pm, tp/Texinfo/Convert/Info.pm (output), tp/Texinfo/Convert/Plaintext.pm (convert), tp/Texinfo/XS/convert/convert_html.c (html_get_tree_root_element) (prepare_special_units, html_internal_command_href) (html_set_pages_files, h [...]
- Previous by thread:
branch master updated: untrack iconv_open-*.h
- Next by thread:
branch master updated: * tp/Texinfo/Convert/Converter.pm (output), tp/Texinfo/Convert/HTML.pm (_internal_command_href, _html_get_tree_root_element) (_html_set_pages_files, _prepare_special_units, _html_convert_convert) (output_internal_links, _html_convert_output), tp/Texinfo/Convert/IXIN.pm, tp/Texinfo/Convert/Info.pm (output), tp/Texinfo/Convert/Plaintext.pm (convert), tp/Texinfo/XS/convert/convert_html.c (html_get_tree_root_element) (prepare_special_units, html_internal_command_href) (html_set_pages_files, h [...]
- Index(es):