From: Chunyan Liu Date: Thu, 5 Jun 2014 09:20:50 +0000 (+0800) Subject: QemuOpts: check NULL input for qemu_opts_del X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~775^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4782183da39ec988b8290bbc0289c9f50ba33ea4;p=sdk%2Femulator%2Fqemu.git QemuOpts: check NULL input for qemu_opts_del To simplify later using of qemu_opts_del, accept NULL input. Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Blake Reviewed-by: Leandro Dorileo Signed-off-by: Chunyan Liu Signed-off-by: Stefan Hajnoczi --- 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)