aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/xml-support.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8451cad..cbb08c3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2020-09-14 Simon Marchi <simon.marchi@polymtl.ca>
+ * xml-support.c (xml_fetch_content_from_file): Replace xfree
+ with gdb::unique_xmalloc_ptr<char>.
+
+2020-09-14 Simon Marchi <simon.marchi@polymtl.ca>
+
* xml-support.h (xml_fetch_another): Change type to be a
function_view.
(xml_process_xincludes): Remove baton parameter.
diff --git a/gdb/xml-support.c b/gdb/xml-support.c
index 8b698e5..5568c8a 100644
--- a/gdb/xml-support.c
+++ b/gdb/xml-support.c
@@ -969,10 +969,10 @@ xml_fetch_content_from_file (const char *filename, const char *dirname)
if (dirname != nullptr && *dirname != '\0')
{
- char *fullname = concat (dirname, "/", filename, (char *) NULL);
+ gdb::unique_xmalloc_ptr<char> fullname
+ (concat (dirname, "/", filename, (char *) NULL));
- file = gdb_fopen_cloexec (fullname, FOPEN_RB);
- xfree (fullname);
+ file = gdb_fopen_cloexec (fullname.get (), FOPEN_RB);
}
else
file = gdb_fopen_cloexec (filename, FOPEN_RB);