texinfo-commits
[Top][All Lists]
Advanced

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

[5701] memory leaks


From: Gavin D. Smith
Subject: [5701] memory leaks
Date: Sat, 05 Jul 2014 19:39:17 +0000

Revision: 5701
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5701
Author:   gavin
Date:     2014-07-05 19:39:16 +0000 (Sat, 05 Jul 2014)
Log Message:
-----------
memory leaks

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/info-utils.c
    trunk/info/infopath.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-07-05 18:49:01 UTC (rev 5700)
+++ trunk/ChangeLog     2014-07-05 19:39:16 UTC (rev 5701)
@@ -1,5 +1,13 @@
 2014-07-05  Gavin Smith  <address@hidden>
 
+       * info/info-utils.c (parse_top_node_line): Free string before loop
+       exit.
+       * info/infopath.c (infopath_add_dir): Free argument if not retained.
+       (build_infopath_from_path): Call infopath_add_dir instead of
+       infopath_add.
+
+2014-07-05  Gavin Smith  <address@hidden>
+
        * info/dir.c (dir_entry_of_infodir)
        * info/footnotes.c (make_footnotes_node) 
        * info/session.c (info_intuit_options_node): Free return value of

Modified: trunk/info/info-utils.c
===================================================================
--- trunk/info/info-utils.c     2014-07-05 18:49:01 UTC (rev 5700)
+++ trunk/info/info-utils.c     2014-07-05 19:39:16 UTC (rev 5701)
@@ -1120,6 +1120,8 @@
       /* TODO: Account for "(dir)" and "(DIR)". */
       value_length = read_quoted_string (inptr, "\n\t,", 1, store_in);
 
+      free (dummy); dummy = 0;
+
       /* Skip past value and any quoting or separating characters. */
       skip_input (value_length);
 
@@ -1130,7 +1132,6 @@
         }
 
       skip_input (1); /* Point after field terminator */
-      free (dummy); dummy = 0;
     }
 }
 

Modified: trunk/info/infopath.c
===================================================================
--- trunk/info/infopath.c       2014-07-05 18:49:01 UTC (rev 5700)
+++ trunk/info/infopath.c       2014-07-05 19:39:16 UTC (rev 5701)
@@ -34,6 +34,7 @@
 /* Exclude default file search directories. */
 int infopath_no_defaults_p;
 
+static void infopath_add_dir (char *path);
 char *extract_colon_unit (char *string, int *idx);
 
 void
@@ -143,12 +144,14 @@
         }
 
       if (dir)
-        infopath_add (temp_dirname);
+        infopath_add_dir (temp_dirname);
       else
         free (temp_dirname);
     }
 }
 
+/* Add directory at PATH to Info search path.  A reference to PATH is retained,
+   or PATH is freed. */
 static void
 infopath_add_dir (char *path)
 {
@@ -159,6 +162,7 @@
   if (stat (path, &dirinfo) == -1)
     {
       debug (2, ("inaccessible directory %s not added to INFOPATH", path));
+      free (path);
       return; /* Doesn't exist, or not accessible. */
     }
 
@@ -171,6 +175,7 @@
           && infodirs[i]->inode != 0)
         {
           debug (2, ("duplicate directory %s not added to INFOPATH", path));
+          free (path);
           return; /* We have it already. */
         }
     }




reply via email to

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