aboutsummaryrefslogtreecommitdiff
path: root/gdb/guile/scm-exception.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/guile/scm-exception.c')
-rw-r--r--gdb/guile/scm-exception.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/gdb/guile/scm-exception.c b/gdb/guile/scm-exception.c
index b62eaeb..0c9cb5d 100644
--- a/gdb/guile/scm-exception.c
+++ b/gdb/guile/scm-exception.c
@@ -234,7 +234,7 @@ SCM
gdbscm_make_type_error (const char *subr, int arg_pos, SCM bad_value,
const char *expected_type)
{
- char *msg;
+ gdb::unique_xmalloc_ptr<char> msg;
SCM result;
if (arg_pos > 0)
@@ -262,9 +262,8 @@ gdbscm_make_type_error (const char *subr, int arg_pos, SCM bad_value,
msg = xstrprintf (_("Wrong type argument: ~S"));
}
- result = gdbscm_make_error (scm_arg_type_key, subr, msg,
+ result = gdbscm_make_error (scm_arg_type_key, subr, msg.get (),
scm_list_1 (bad_value), scm_list_1 (bad_value));
- xfree (msg);
return result;
}
@@ -279,7 +278,7 @@ static SCM
gdbscm_make_arg_error (SCM key, const char *subr, int arg_pos, SCM bad_value,
const char *error_prefix, const char *error)
{
- char *msg;
+ gdb::unique_xmalloc_ptr<char> msg;
SCM result;
if (error_prefix != NULL)
@@ -300,9 +299,8 @@ gdbscm_make_arg_error (SCM key, const char *subr, int arg_pos, SCM bad_value,
msg = xstrprintf (_("%s: ~S"), error);
}
- result = gdbscm_make_error (key, subr, msg,
- scm_list_1 (bad_value), scm_list_1 (bad_value));
- xfree (msg);
+ result = gdbscm_make_error (key, subr, msg.get (), scm_list_1 (bad_value),
+ scm_list_1 (bad_value));
return result;
}