diff --git a/monitor.c b/monitor.c index d8ac20f6caf7302dccb9fc716731d80fcd86489c..61b7982678b6f496b1bc9ffa1868ad5a3ca222d8 100644 --- a/monitor.c +++ b/monitor.c @@ -3842,7 +3842,7 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens) req_json = qobject_to_json(req); trace_handle_qmp_command(mon, qstring_get_str(req_json)); - qobject_decref(QOBJECT(req_json)); + QDECREF(req_json); rsp = qmp_dispatch(cur_mon->qmp.commands, req); diff --git a/scripts/coccinelle/qobject.cocci b/scripts/coccinelle/qobject.cocci index c3253deb1ba350e509952a445b9dc3720b45988e..c518caf7b1ca37a75c71346e3b3154756ac66d6a 100644 --- a/scripts/coccinelle/qobject.cocci +++ b/scripts/coccinelle/qobject.cocci @@ -3,6 +3,12 @@ expression Obj, Key, E; @@ ( +- qobject_incref(QOBJECT(E)); ++ QINCREF(E); +| +- qobject_decref(QOBJECT(E)); ++ QDECREF(E); +| - qdict_put_obj(Obj, Key, QOBJECT(E)); + qdict_put(Obj, Key, E); |