texinfo-commits
[Top][All Lists]
Advanced

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

[5812] fix memory leak when looking for index nodes


From: Gavin D. Smith
Subject: [5812] fix memory leak when looking for index nodes
Date: Mon, 08 Sep 2014 16:08:26 +0000

Revision: 5812
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5812
Author:   gavin
Date:     2014-09-08 16:08:25 +0000 (Mon, 08 Sep 2014)
Log Message:
-----------
fix memory leak when looking for index nodes

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/indices.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-09-08 15:58:56 UTC (rev 5811)
+++ trunk/ChangeLog     2014-09-08 16:08:25 UTC (rev 5812)
@@ -4,6 +4,11 @@
        footnotes nodes for footnotes nodes.
        * info/t/split-footnotes.sh: New test.
 
+       * info/indices.c (info_indices_of_file_buffer): Only record first
+       index found in initial_index_nodename.  This stops a memory leak
+       when there are multiple indices, and means that "i<RET>" goes to
+       the first index node in the file.
+
 2014-09-08  Gavin Smith  <address@hidden>
 
        * info/session.c (free_history_node): Free 'nodename' field for

Modified: trunk/info/indices.c
===================================================================
--- trunk/info/indices.c        2014-09-08 15:58:56 UTC (rev 5811)
+++ trunk/info/indices.c        2014-09-08 16:08:25 UTC (rev 5812)
@@ -133,9 +133,12 @@
               if (!node)
                 continue;
 
-              /* Remember the filename and nodename of this index. */
-              initial_index_filename = xstrdup (file_buffer->filename);
-              initial_index_nodename = xstrdup (tag->nodename);
+              if (!initial_index_filename)
+                {
+                  /* Remember the filename and nodename of this index. */
+                  initial_index_filename = xstrdup (file_buffer->filename);
+                  initial_index_nodename = xstrdup (tag->nodename);
+                }
 
               menu = node->references;
 




reply via email to

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