Message ID | 20200603080904.997083-6-maozhongyi@cmss.chinamobile.com |
---|---|
State | New |
Headers | show |
Series | monitor/hmp-cmds: small improvements for migration | expand |
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 6938f1060e..acdd6baff3 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -1636,9 +1636,8 @@ void hmp_object_add(Monitor *mon, const QDict *qdict) obj = user_creatable_add_opts(opts, &err); qemu_opts_del(opts); - if (err) { - hmp_handle_error(mon, err); - } + hmp_handle_error(mon, err); + if (obj) { object_unref(obj); }
hmp_handle_error() does Error check internally. Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com> --- monitor/hmp-cmds.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)