qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v23 10/32] check NULL input for qemu_opts_del


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v23 10/32] check NULL input for qemu_opts_del
Date: Tue, 25 Mar 2014 15:41:10 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

On 03/21/2014 04:12 AM, Chunyan Liu wrote:
> To simplify later using of qemu_opts_del, accept NULL input.
> 
> Signed-off-by: Chunyan Liu <address@hidden>
> ---
>  util/qemu-option.c | 4 ++++
>  1 file changed, 4 insertions(+)

Reviewed-by: Eric Blake <address@hidden>

> 
> diff --git a/util/qemu-option.c b/util/qemu-option.c
> index 6c304b2..e9802f3 100644
> --- a/util/qemu-option.c
> +++ b/util/qemu-option.c
> @@ -990,6 +990,10 @@ void qemu_opts_del(QemuOpts *opts)
>  {
>      QemuOpt *opt;
>  
> +    if (opts == NULL) {
> +        return;
> +    }
> +
>      for (;;) {
>          opt = QTAILQ_FIRST(&opts->head);
>          if (opt == NULL)
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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