*** ../bash-4.2-patched/assoc.c 2009-08-05 20:19:40.000000000 -0400 --- assoc.c 2011-10-04 20:23:07.000000000 -0400 *************** *** 78,81 **** --- 78,86 ---- if (b == 0) return -1; + /* If we are overwriting an existing element's value, we're not going to + use the key. Nothing in the array assignment code path frees the key + string, so we can free it here to avoid a memory leak. */ + if (b->key != key) + free (key); FREE (b->data); b->data = value ? savestring (value) : (char *)0;