diff options
author | Pedro Alves <palves@redhat.com> | 2017-09-21 00:34:41 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2017-09-21 00:34:41 +0100 |
commit | c83833f49353e1fe7fa727291210be751161ade1 (patch) | |
tree | 1f970e1e52f2ade2132135fa24846826d34e460e /gdb/ChangeLog | |
parent | ca464aac1b0a444f7debb8fc1e5e8b3f30602a35 (diff) | |
download | gdb-c83833f49353e1fe7fa727291210be751161ade1.zip gdb-c83833f49353e1fe7fa727291210be751161ade1.tar.gz gdb-c83833f49353e1fe7fa727291210be751161ade1.tar.bz2 |
eval.c:evaluate_subexp_standard: Use RAII to avoid leaks
While working on the no-debug-info debugging improvements series, I
noticed these bare xfree calls, which lead to leaks if
evaluate_subexp_standard throws.
Fix that by reworking make_params as a RAII class. Ends up
eliminating a couple heap allocations too.
gdb/ChangeLog:
2017-09-20 Pedro Alves <palves@redhat.com>
* eval.c (make_params): Delete, refactored as ...
(class fake_method): ... this new type's ctor.
(fake_method::~fake_method): New.
(evaluate_subexp_standard): Use 'fake_method'.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 89a6c29..4de6da2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2017-09-20 Pedro Alves <palves@redhat.com> + + * eval.c (make_params): Delete, refactored as ... + (class fake_method): ... this new type's ctor. + (fake_method::~fake_method): New. + (evaluate_subexp_standard): Use 'fake_method'. + 2017-09-20 Tom Tromey <tom@tromey.com> * windows-nat.c (get_windows_debug_event, windows_wait) |