migration: free result string

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reported-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
Juan Quintela 2017-10-30 14:27:40 +01:00
parent 2e3c8f8dbd
commit 9c43435dc1

View File

@ -358,13 +358,14 @@ static void migrate_check_parameter(QTestState *who, const char *parameter,
const char *value) const char *value)
{ {
QDict *rsp, *rsp_return; QDict *rsp, *rsp_return;
const char *result; char *result;
rsp = wait_command(who, "{ 'execute': 'query-migrate-parameters' }"); rsp = wait_command(who, "{ 'execute': 'query-migrate-parameters' }");
rsp_return = qdict_get_qdict(rsp, "return"); rsp_return = qdict_get_qdict(rsp, "return");
result = g_strdup_printf("%" PRId64, result = g_strdup_printf("%" PRId64,
qdict_get_try_int(rsp_return, parameter, -1)); qdict_get_try_int(rsp_return, parameter, -1));
g_assert_cmpstr(result, ==, value); g_assert_cmpstr(result, ==, value);
g_free(result);
QDECREF(rsp); QDECREF(rsp);
} }