texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Gavin D. Smith
Date: Tue, 25 Oct 2022 15:22:19 -0400 (EDT)

branch: master
commit e3bf3039e840745240f82e9c48ba38720387b5d9
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Tue Oct 25 18:32:13 2022 +0100

    * info/scan.c (scan_node_contents): Free node contents if
    N_WasRewritten flag is set.  This avoids a memory leak in
    the t/index-search.sh test.
---
 ChangeLog   | 6 ++++++
 info/scan.c | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index dec35790f8..11f434a26c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-10-25  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       * info/scan.c (scan_node_contents): Free node contents if
+       N_WasRewritten flag is set.  This avoids a memory leak in
+       the t/index-search.sh test.
+
 2022-10-25  Gavin Smith  <gavinsmith0123@gmail.com>
 
        * README-hacking: advice on valgrind
diff --git a/info/scan.c b/info/scan.c
index 6286b317f0..a52117ed2c 100644
--- a/info/scan.c
+++ b/info/scan.c
@@ -1653,6 +1653,8 @@ not_a_reference:
 
   if (rewrite_p)
     {
+      if (node->flags & N_WasRewritten)
+        free (node->contents);
       node->contents = text_buffer_base (&output_buf);
       node->flags |= N_WasRewritten;
  



reply via email to

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