diff options
Diffstat (limited to 'tests/libqtest.c')
-rw-r--r-- | tests/libqtest.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/libqtest.c b/tests/libqtest.c index 9e3870bb7d..81b17f6fc9 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -1054,12 +1054,9 @@ void qtest_qmp_device_add(const char *driver, const char *id, const char *fmt, void qtest_qmp_device_del(const char *id) { QDict *response1, *response2, *event = NULL; - char *cmd; - cmd = g_strdup_printf("{'execute': 'device_del'," - " 'arguments': { 'id': '%s' }}", id); - response1 = qmp(cmd); - g_free(cmd); + response1 = qmp("{'execute': 'device_del', 'arguments': {'id': %s}}", + id); g_assert(response1); g_assert(!qdict_haskey(response1, "error")); |