mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
qerror: qerror_format(): return an allocated string
Simplifies current and future users. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
5f0f0e13e1
commit
2b38cf2e03
3 changed files with 10 additions and 7 deletions
5
error.c
5
error.c
|
@ -65,10 +65,7 @@ bool error_is_set(Error **errp)
|
|||
const char *error_get_pretty(Error *err)
|
||||
{
|
||||
if (err->msg == NULL) {
|
||||
QString *str;
|
||||
str = qerror_format(err->fmt, err->obj);
|
||||
err->msg = g_strdup(qstring_get_str(str));
|
||||
QDECREF(str);
|
||||
err->msg = qerror_format(err->fmt, err->obj);
|
||||
}
|
||||
|
||||
return err->msg;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue