qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH v24 10/31] QemuOpts: check NULL input for qemu_opts_


From: Chunyan Liu
Subject: [Qemu-devel] [PATCH v24 10/31] QemuOpts: check NULL input for qemu_opts_del
Date: Thu, 3 Apr 2014 17:54:28 +0800

To simplify later using of qemu_opts_del, accept NULL input.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Chunyan Liu <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 c9df671..c4c7545 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -1010,6 +1010,10 @@ void qemu_opts_del(QemuOpts *opts)
 {
     QemuOpt *opt;
 
+    if (opts == NULL) {
+        return;
+    }
+
     for (;;) {
         opt = QTAILQ_FIRST(&opts->head);
         if (opt == NULL)
-- 
1.7.12.4




reply via email to

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