texinfo-commits
[Top][All Lists]
Advanced

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

[6965] info fix memory problems


From: Gavin D. Smith
Subject: [6965] info fix memory problems
Date: Sat, 30 Jan 2016 14:38:36 +0000

Revision: 6965
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6965
Author:   gavin
Date:     2016-01-30 14:38:35 +0000 (Sat, 30 Jan 2016)
Log Message:
-----------
info fix memory problems

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/nodes.c
    trunk/info/session.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2016-01-30 12:09:32 UTC (rev 6964)
+++ trunk/ChangeLog     2016-01-30 14:38:35 UTC (rev 6965)
@@ -1,5 +1,13 @@
-2016-01-25  Gavin Smith  <address@hidden>
+2016-01-30  Gavin Smith  <address@hidden>
 
+       * info/session.c (gc_file_buffers_and_nodes): Don't free file 
+       buffers corresponding to files that aren't there any more, 
+       because a node may still refer to them.
+       * info/nodes.c (forget_info_file): Overwrite filename of field 
+       with empty string to avoid a memory leak.
+
+2016-01-30  Gavin Smith  <address@hidden>
+
        * info/nodes.c (info_node_of_tag_ext): Check that references for 
        node haven't already been initialized before calling 
        scan_node_contents, to prevent a memory leak if a node from a 

Modified: trunk/info/nodes.c
===================================================================
--- trunk/info/nodes.c  2016-01-30 12:09:32 UTC (rev 6964)
+++ trunk/info/nodes.c  2016-01-30 14:38:35 UTC (rev 6965)
@@ -812,7 +812,7 @@
 forget_info_file (FILE_BUFFER *file_buffer)
 {
   file_buffer->flags |= N_Gone;
-  file_buffer->filename = "";
+  file_buffer->filename[0] = '\0';
   file_buffer->fullpath = "";
   memset (&file_buffer->finfo, 0, sizeof (struct stat));
 }

Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c        2016-01-30 12:09:32 UTC (rev 6964)
+++ trunk/info/session.c        2016-01-30 14:38:35 UTC (rev 6965)
@@ -1792,6 +1792,11 @@
           if (fb->flags & N_CannotGC)
             continue;
 
+          /* Don't free file buffers corresponding to files that aren't there 
+             any more, because a node may still refer to them. */
+          if (fb->flags & N_Gone)
+            continue;
+
           free (fb->contents);
           fb->contents = 0;
 




reply via email to

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