diff options
author | Pedro Alves <palves@redhat.com> | 2019-01-10 17:52:39 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2019-01-10 18:03:41 +0000 |
commit | 2f667667e24357ff54701f3e046820cf08d649cf (patch) | |
tree | 3ad7eae1701702713630735513d85ecd24e828db /gdb/solib-target.c | |
parent | 36cb72375cc371b786ceaec588ec26f8c55ae2ec (diff) | |
download | gdb-2f667667e24357ff54701f3e046820cf08d649cf.zip gdb-2f667667e24357ff54701f3e046820cf08d649cf.tar.gz gdb-2f667667e24357ff54701f3e046820cf08d649cf.tar.bz2 |
Fix leak in solib-target.c:library_list_start_library
lm_info_target::name is nowadays std::string, so we're leaking the
result of xstrdup.
gdb/ChangeLog:
2019-01-10 Pedro Alves <palves@redhat.com>
* solib-target.c (library_list_start_library): Don't xstrdup name.
Diffstat (limited to 'gdb/solib-target.c')
-rw-r--r-- | gdb/solib-target.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/solib-target.c b/gdb/solib-target.c index 17b958e..972d9ef 100644 --- a/gdb/solib-target.c +++ b/gdb/solib-target.c @@ -124,10 +124,9 @@ library_list_start_library (struct gdb_xml_parser *parser, { VEC(lm_info_target_p) **list = (VEC(lm_info_target_p) **) user_data; lm_info_target *item = new lm_info_target; - const char *name + item->name = (const char *) xml_find_attribute (attributes, "name")->value.get (); - item->name = xstrdup (name); VEC_safe_push (lm_info_target_p, *list, item); } |