aboutsummaryrefslogtreecommitdiff
path: root/gdb/guile/scm-safe-call.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/guile/scm-safe-call.c')
-rw-r--r--gdb/guile/scm-safe-call.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/guile/scm-safe-call.c b/gdb/guile/scm-safe-call.c
index 64a69a3..15bab27 100644
--- a/gdb/guile/scm-safe-call.c
+++ b/gdb/guile/scm-safe-call.c
@@ -438,19 +438,18 @@ gdbscm_safe_source_script (const char *filename)
%load-path, but we don't want %load-path to be searched. At least not
by default. This function is invoked by the "source" GDB command which
already has its own path search support. */
- char *abs_filename = NULL;
+ gdb::unique_xmalloc_ptr<char> abs_filename;
const char *result;
if (!IS_ABSOLUTE_PATH (filename))
{
abs_filename = gdb_realpath (filename);
- filename = abs_filename;
+ filename = abs_filename.get ();
}
result = gdbscm_with_guile (scscm_source_scheme_script,
(void *) filename);
- xfree (abs_filename);
if (result != NULL)
return xstrdup (result);
return NULL;