* breakpoint.c (bpstat_copy): Call RELEASE_VALUE on the new OLD_VAL.

gdb/testsuite/
	* gdb.base/value-double-free.exp, gdb.base/value-double-free.c: New.
This commit is contained in:
Jan Kratochvil
2008-07-07 22:39:59 +00:00
parent 42f0bc8eaf
commit 3c3185ac88
5 changed files with 86 additions and 1 deletions

View File

@@ -1996,7 +1996,10 @@ bpstat_copy (bpstat bs)
if (bs->commands != NULL)
tmp->commands = copy_command_lines (bs->commands);
if (bs->old_val != NULL)
tmp->old_val = value_copy (bs->old_val);
{
tmp->old_val = value_copy (bs->old_val);
release_value (tmp->old_val);
}
if (p == NULL)
/* This is the first thing in the chain. */