7 Bug-Reported-by: "David Parks" <davidparks21@yahoo.com>
8 Bug-Reference-ID: <014101cc82c6$46ac1540$d4043fc0$@com>
9 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-10/msg00031.html
13 Overwriting a value in an associative array causes the memory allocated to
14 store the key on the second and subsequent assignments to leak.
16 Patch (apply with `patch -p0'):
18 *** ../bash-4.2-patched/assoc.c 2009-08-05 20:19:40.000000000 -0400
19 --- assoc.c 2011-10-04 20:23:07.000000000 -0400
25 + /* If we are overwriting an existing element's value, we're not going to
26 + use the key. Nothing in the array assignment code path frees the key
27 + string, so we can free it here to avoid a memory leak. */
31 b->data = value ? savestring (value) : (char *)0;
32 *** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
33 --- patchlevel.h Thu Feb 24 21:41:34 2011
36 looks for to find the patch level (for the sccs version string). */
38 ! #define PATCHLEVEL 10
40 #endif /* _PATCHLEVEL_H_ */
42 looks for to find the patch level (for the sccs version string). */
44 ! #define PATCHLEVEL 11
46 #endif /* _PATCHLEVEL_H_ */