aboutsummaryrefslogtreecommitdiff
path: root/gdb/ChangeLog
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-08-03 17:07:06 -0600
committerTom Tromey <tom@tromey.com>2017-08-14 08:31:07 -0600
commitf978cb06dbfbd93dbd52bd39d992f8644b0c639e (patch)
tree094f0fe74f05bd69cc6622369c3c40c8a1526ca7 /gdb/ChangeLog
parent2f5404b3581d125a96f14d92c4a7985e8156d1d6 (diff)
downloadgdb-f978cb06dbfbd93dbd52bd39d992f8644b0c639e.zip
gdb-f978cb06dbfbd93dbd52bd39d992f8644b0c639e.tar.gz
gdb-f978cb06dbfbd93dbd52bd39d992f8644b0c639e.tar.bz2
Fix memory leak in add_symbol_file_command
I happened to notice that add_symbol_file_command leaks "sect_opts". This patch fixes the leak by changing sect_opts to be a std::vector. I had to change the logic in the loop a little bit. Previously, it was incrementing section_index after completing an entry; but this changes it to push a new entry when the name is seen. I believe the argument parsing here is mildly incorrect, in that nothing checks whether the -s option actually had any arguments. Maybe gdb can crash if "-s NAME" is given without an argument. I didn't try to fix this in this patch, but I do have another patch I can send later that fixes it up. Regression tested on the buildbot. ChangeLog 2017-08-11 Tom Tromey <tom@tromey.com> * symfile.c (add_symbol_file_command): Use std::vector.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r--gdb/ChangeLog4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 384d4d3..dcb591d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2017-08-11 Tom Tromey <tom@tromey.com>
+
+ * symfile.c (add_symbol_file_command): Use std::vector.
+
2017-08-14 Tom Tromey <tom@tromey.com>
* break-catch-throw.c (handle_gnu_v3_exceptions): Use std::move.