summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorChunyan Liu <cyliu@suse.com>2014-06-05 17:20:50 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2014-06-16 17:23:20 +0800
commit4782183da39ec988b8290bbc0289c9f50ba33ea4 (patch)
treee08f694a079cf365736e24aaa58f55422ecfb227 /util
parenta1097a2614c3ff772e450454417bb1b51d6a01bc (diff)
downloadqemu-4782183da39ec988b8290bbc0289c9f50ba33ea4.tar.gz
qemu-4782183da39ec988b8290bbc0289c9f50ba33ea4.tar.bz2
qemu-4782183da39ec988b8290bbc0289c9f50ba33ea4.zip
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>
Diffstat (limited to 'util')
-rw-r--r--util/qemu-option.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/util/qemu-option.c b/util/qemu-option.c
index 6acfb0eb41..40e1ff384a 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -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)