Re: [PATCH spice-common] codegen: Do not generate extra null check

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

 



On Mon, Jul 25, 2016 at 6:40 PM, Pavel Grunt <pgrunt@xxxxxxxxxx> wrote:
> Spotted by coverity

Although I remember seeing free (NULL); crashing in some really old
BDSs, it's a no-op in pretty much any modern system.

> ---
>  python_modules/demarshal.py | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py
> index 2252f37..de2ccd0 100644
> --- a/python_modules/demarshal.py
> +++ b/python_modules/demarshal.py
> @@ -1098,8 +1098,7 @@ def write_msg_parser(writer, message):
>      writer.newline()
>      if writer.has_error_check:
>          writer.label("error")
> -        with writer.block("if (data != NULL)"):
> -            writer.statement("free(data)")
> +        writer.statement("free(data)")
>          writer.statement("return NULL")
>      writer.end_block()
>
> --
> 2.9.2
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel


Acked-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>

-- 
Fabiano Fidêncio
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]