qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 17/39] QemuOpts: check NULL input for qemu_opts_del


From: Stefan Hajnoczi
Subject: [Qemu-devel] [PULL 17/39] QemuOpts: check NULL input for qemu_opts_del
Date: Mon, 16 Jun 2014 19:23:41 +0800

From: Chunyan Liu <address@hidden>

To simplify later using of qemu_opts_del, accept NULL input.

Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Leandro Dorileo <address@hidden>
Signed-off-by: Chunyan Liu <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
 util/qemu-option.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/util/qemu-option.c b/util/qemu-option.c
index 6acfb0e..40e1ff3 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)
-- 
1.9.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]