Blob Blame History Raw
diff -up texinfo-6.4/info/search.c.orig texinfo-6.4/info/search.c
--- texinfo-6.4/info/search.c.orig	2017-04-17 09:39:56.000000000 +0200
+++ texinfo-6.4/info/search.c	2017-12-04 11:31:09.180059724 +0100
@@ -201,6 +201,7 @@ regexp_search (char *regexp, int is_lite
       char *buf = xmalloc (size);
       regerror (result, &preg, buf, size);
       info_error (_("regexp error: %s"), buf);
+      free (buf);
       return search_invalid;
     }
 
@@ -215,7 +216,10 @@ regexp_search (char *regexp, int is_lite
   extend_matches (match_state);
 
   if (match_state->match_count == 0)
-    return search_not_found;
+    {
+      free_matches (match_state);
+      return search_not_found;
+    }
   else
     return search_success;
 }
diff -up texinfo-6.4/info/session.c.orig texinfo-6.4/info/session.c
--- texinfo-6.4/info/session.c.orig	2017-12-04 11:31:15.023062714 +0100
+++ texinfo-6.4/info/session.c	2017-12-04 11:31:41.870076452 +0100
@@ -3953,10 +3953,7 @@ info_search_in_node_internal (WINDOW *wi
     }
   
   if (result != search_success)
-    {
-      free_matches (&matches);
       return result;
-    }
 
   if (node->flags & N_Simple)
     {