changeset 3550:be1bb4dc32b1

[xemacs-hg @ 2006-08-08 15:26:05 by james] Fix a memory leak. <m34pwtpytp.fsf@jerrypc.cs.usu.edu>
author james
date Tue, 08 Aug 2006 15:26:08 +0000
parents 19e39904f5d8
children 4d9e7064044b
files src/ChangeLog src/keymap.c
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Aug 07 21:51:30 2006 +0000
+++ b/src/ChangeLog	Tue Aug 08 15:26:08 2006 +0000
@@ -1,3 +1,8 @@
+2006-08-03  Jerry James  <james@xemacs.org>
+
+	* keymap.c (where_is_recursive_mapper): Use the freshly allocated
+	storage instead of leaking it.
+
 2006-08-06  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* doc.c (Fsnarf_documentation):
--- a/src/keymap.c	Mon Aug 07 21:51:30 2006 +0000
+++ b/src/keymap.c	Tue Aug 08 15:26:08 2006 +0000
@@ -3754,6 +3754,8 @@
 	      Lisp_Key_Data *new_ = xnew_array (Lisp_Key_Data, size);
 	      memcpy ((void *)new_, (const void *)c->keys_so_far,
 		      c->keys_so_far_total_size * sizeof (Lisp_Key_Data));
+	      xfree (c->keys_so_far, Lisp_Key_Data);
+	      c->keys_so_far = new_;
 	    }
 	  else
 	    XREALLOC_ARRAY (c->keys_so_far, Lisp_Key_Data, size);