changeset 1269:abaf21f34109

[project @ 1995-04-20 19:16:24 by jwe]
author jwe
date Thu, 20 Apr 1995 19:18:13 +0000
parents 76a0c05089d4
children 0a5e9e8892a0
files kpathsea/pathsearch.c src/pt-misc.h
diffstat 2 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/kpathsea/pathsearch.c	Thu Apr 20 19:15:51 1995 +0000
+++ b/kpathsea/pathsearch.c	Thu Apr 20 19:18:13 1995 +0000
@@ -265,7 +265,10 @@
       
       /* Free the list space, if any (but not the elements).  */
       if (found)
-        free (found);
+	{
+	  str_list_free (found);
+	  free (found);
+	}
     }
 
   /* Free the expanded name we were passed.  It can't be in the return
@@ -327,8 +330,14 @@
 kpse_path_search P3C(const_string, path,  const_string, name,
                      boolean, must_exist)
 {
-  string *ret_list = search (path, name, must_exist, false);
-  return *ret_list;
+  static string *ret_list;
+
+  if (ret_list)
+    free (ret_list);
+
+  ret_list = search (path, name, must_exist, false);
+
+  return *ret_list;  /* Freeing this is caller's responsibility */
 }
 
 
--- a/src/pt-misc.h	Thu Apr 20 19:15:51 1995 +0000
+++ b/src/pt-misc.h	Thu Apr 20 19:18:13 1995 +0000
@@ -237,6 +237,8 @@
 {
 public:
   tree_va_return_list (void) : SLList<tree_constant> () { }
+
+  ~tree_va_return_list (void) { }
 };
 
 // List of expressions that make up a global statement.