aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 94307cb..6fa9d59 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -3083,7 +3083,7 @@ target_fileio_read_alloc (struct inferior *inf, const char *filename,
/* See target.h. */
-char *
+gdb::unique_xmalloc_ptr<char>
target_fileio_read_stralloc (struct inferior *inf, const char *filename)
{
gdb_byte *buffer;
@@ -3094,10 +3094,10 @@ target_fileio_read_stralloc (struct inferior *inf, const char *filename)
bufstr = (char *) buffer;
if (transferred < 0)
- return NULL;
+ return gdb::unique_xmalloc_ptr<char> (nullptr);
if (transferred == 0)
- return xstrdup ("");
+ return gdb::unique_xmalloc_ptr<char> (xstrdup (""));
bufstr[transferred] = 0;
@@ -3111,7 +3111,7 @@ target_fileio_read_stralloc (struct inferior *inf, const char *filename)
break;
}
- return bufstr;
+ return gdb::unique_xmalloc_ptr<char> (bufstr);
}