aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-11-20 08:31:49 +0100
committerThomas Huth <thuth@redhat.com>2020-11-20 15:04:16 +0100
commit88a8b27e556f5cb49a19d4c98a96590f61b74ed2 (patch)
tree09cd6582660f7fbdd56895392c161a8397f53058 /tests
parent7aed584ca6a11b6c8e673f3a8ba56c927d076440 (diff)
downloadqemu-88a8b27e556f5cb49a19d4c98a96590f61b74ed2.zip
qemu-88a8b27e556f5cb49a19d4c98a96590f61b74ed2.tar.gz
qemu-88a8b27e556f5cb49a19d4c98a96590f61b74ed2.tar.bz2
qtest: do not return freed argument vector from qtest_rsp
If expected_args is 0, qtest frees the argument vector and then returns it nevertheless. Coverity complains; in practice this is not an issue because expected_args == 0 means that the caller is not interested in the argument vector, but it would be a potential problem if somebody wanted to add commands with optional arguments to qtest. Suggested-by: Kamil Dudka <kdudka@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201120073149.99079-1-pbonzini@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtest/libqtest.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index be0fb43..e49f3a1 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -545,6 +545,7 @@ redo:
}
} else {
g_strfreev(words);
+ words = NULL;
}
return words;