leak: Clear history before exiting guestfish.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 21 Sep 2010 18:49:08 +0000 (19:49 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 21 Sep 2010 18:51:22 +0000 (19:51 +0100)
Clear the in-memory history before exiting.  This removes
some but not all memory leaks associated with using the GNU
History library.  As far as I can tell it is not possible to
free up everything used by GNU History.

(Found by valgrind).

fish/fish.c

index de11b2f..6192860 100644 (file)
@@ -1436,6 +1436,7 @@ cleanup_readline (void)
 #else
     (void) write_history (histfile);
 #endif
+    clear_history ();
   }
 #endif
 }