diff options
author | Pedro Alves <palves@redhat.com> | 2017-06-06 15:53:59 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2017-06-06 15:53:59 +0100 |
commit | e1e01040aa83ddef0bb5c60a8b187f769b2b1ec3 (patch) | |
tree | 1b37b56bd113804c14d9835523a018330e5cd999 /gdb/ChangeLog | |
parent | fbe654c8bc78eb06b6d7ee4fcec64e9e34e7a9ac (diff) | |
download | gdb-e1e01040aa83ddef0bb5c60a8b187f769b2b1ec3.zip gdb-e1e01040aa83ddef0bb5c60a8b187f769b2b1ec3.tar.gz gdb-e1e01040aa83ddef0bb5c60a8b187f769b2b1ec3.tar.bz2 |
Fix double free when running gdb.linespec/ls-errs.exp (PR breakpoints/21553)
The problem is that b->extra_string is free'ed twice: Once in the
breakpoint's dtor, and another time via make_cleanup (xfree).
This patch gets rid of the cleanups, fixing the problem.
Tested on x86_64 GNU/Linux.
gdb/ChangeLog:
2017-06-06 Pedro Alves <palves@redhat.com>
PR breakpoints/21553
* breakpoint.c (create_breakpoints_sal_default)
(init_breakpoint_sal, create_breakpoint_sal): Use
gdb::unique_xmalloc_ptr for string parameters.
(create_breakpoint): Constify 'extra_string' and 'cond_string'
parameters. Replace cleanups with gdb::unique_xmalloc_ptr.
(base_breakpoint_create_breakpoints_sal)
(bkpt_create_breakpoints_sal, tracepoint_create_breakpoints_sal)
(strace_marker_create_breakpoints_sal)
(create_breakpoints_sal_default): Use gdb::unique_xmalloc_ptr for
string parameters.
* breakpoint.h (breakpoint_ops::create_breakpoints_sal): Use
gdb::unique_xmalloc_ptr for string parameters.
(create_breakpoint): Constify 'extra_string' and 'cond_string'
parameters.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 319e9c4..0073122 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,21 @@ +2017-06-06 Pedro Alves <palves@redhat.com> + + PR breakpoints/21553 + * breakpoint.c (create_breakpoints_sal_default) + (init_breakpoint_sal, create_breakpoint_sal): Use + gdb::unique_xmalloc_ptr for string parameters. + (create_breakpoint): Constify 'extra_string' and 'cond_string' + parameters. Replace cleanups with gdb::unique_xmalloc_ptr. + (base_breakpoint_create_breakpoints_sal) + (bkpt_create_breakpoints_sal, tracepoint_create_breakpoints_sal) + (strace_marker_create_breakpoints_sal) + (create_breakpoints_sal_default): Use gdb::unique_xmalloc_ptr for + string parameters. + * breakpoint.h (breakpoint_ops::create_breakpoints_sal): Use + gdb::unique_xmalloc_ptr for string parameters. + (create_breakpoint): Constify 'extra_string' and 'cond_string' + parameters. + 2017-06-06 Alan Hayward <alan.hayward@arm.com> * alpha-tdep.c (alpha_register_to_value): Use |