mirror of
https://github.com/qemu/qemu.git
synced 2024-11-23 19:03:38 +08:00
Revert "qapi: Clean up superfluous null check in qapi_dealloc_type_str()"
This reverts commit 25a7017555
.
Turns out the argument *can* be null: QEMU now segfaults if it
receives an invalid parameter via a qmp command instead of throwing an
error.
For example:
{ "execute": "blockdev-add",
"arguments": { "options" : { "driver": "invalid-driver" } } }
CC: qemu-stable@nongnu.org
Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
cc1626556d
commit
b690d679c1
@ -131,7 +131,9 @@ static void qapi_dealloc_end_list(Visitor *v, Error **errp)
|
||||
static void qapi_dealloc_type_str(Visitor *v, char **obj, const char *name,
|
||||
Error **errp)
|
||||
{
|
||||
g_free(*obj);
|
||||
if (obj) {
|
||||
g_free(*obj);
|
||||
}
|
||||
}
|
||||
|
||||
static void qapi_dealloc_type_int(Visitor *v, int64_t *obj, const char *name,
|
||||
|
Loading…
Reference in New Issue
Block a user