]> Git Repo - qemu.git/commitdiff
QemuOpts: check NULL input for qemu_opts_del
authorChunyan Liu <[email protected]>
Thu, 5 Jun 2014 09:20:50 +0000 (17:20 +0800)
committerStefan Hajnoczi <[email protected]>
Mon, 16 Jun 2014 09:23:20 +0000 (17:23 +0800)
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]>
util/qemu-option.c

index 6acfb0eb41f149d435cf56aa4ee2708deaa87f8c..40e1ff384aa6e16476478ad087af955a8fb589df 100644 (file)
@@ -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)
This page took 0.027347 seconds and 4 git commands to generate.