mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-17 21:26:13 -07:00
QemuOpts: check NULL input for qemu_opts_del
To simplify later using of qemu_opts_del, accept NULL input. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Leandro Dorileo <l@dorileo.org> Signed-off-by: Chunyan Liu <cyliu@suse.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
a1097a2614
commit
4782183da3
1 changed files with 4 additions and 0 deletions
|
|
@ -1011,6 +1011,10 @@ void qemu_opts_del(QemuOpts *opts)
|
|||
{
|
||||
QemuOpt *opt;
|
||||
|
||||
if (opts == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
opt = QTAILQ_FIRST(&opts->head);
|
||||
if (opt == NULL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue