gdb: use make_unique_xstrdup in debuginfod-support.c
authorSimon Marchi <simon.marchi@polymtl.ca>
Tue, 15 Sep 2020 02:28:25 +0000 (22:28 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 15 Sep 2020 02:28:25 +0000 (22:28 -0400)
Use make_unique_xstrdup instead of reset + xstrdup.

gdb/ChangeLog:

* debuginfod-support.c (debuginfod_source_query): Use
make_unique_xstrdup.

Change-Id: Iee9524fea7630b4d6ee5c74e30c60fe222dc1d2c

gdb/ChangeLog
gdb/debuginfod-support.c

index a68c1ab248a7d3bbe4917a2d372bcb44445d557c..9ae49008d275a51a10ecea8023d75722a3d48498 100644 (file)
@@ -1,3 +1,8 @@
+2020-09-14  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * debuginfod-support.c (debuginfod_source_query): Use
+       make_unique_xstrdup.
+
 2020-09-14  Simon Marchi  <simon.marchi@efficios.com>
 
        * gdbtypes.h (TYPE_INSTANCE_FLAGS): Remove, replace all uses
index 0dc88c2c2a10648517386414035b56cfb0f4ab54..73db5360c41da260aa18682101c15b27ab09cbbb 100644 (file)
@@ -121,7 +121,7 @@ debuginfod_source_query (const unsigned char *build_id,
                     safe_strerror (-fd.get ()),
                     styled_string (file_name_style.style (),  srcpath));
   else
-    destname->reset (xstrdup (srcpath));
+    *destname = make_unique_xstrdup (srcpath);
 
   debuginfod_end (c);
   return fd;