Skip to content

Commit

Permalink
QemuOpts: check NULL input for qemu_opts_del
Browse files Browse the repository at this point in the history
To simplify later using of qemu_opts_del, accept NULL input.

Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Leandro Dorileo <[email protected]>
Signed-off-by: Chunyan Liu <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
  • Loading branch information
Chunyan Liu authored and stefanhaRH committed Jun 16, 2014
1 parent a1097a2 commit 4782183
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions util/qemu-option.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4782183

Please sign in to comment.