[Spice-devel] [PATCH qxl-wddm-dod 01/12] Do not check for NULL before calling delete

Pavel Grunt pgrunt at redhat.com
Wed Apr 12 13:56:16 UTC 2017


On Wed, 2017-04-12 at 14:19 +0100, Frediano Ziglio wrote:
> The check is done already by C++.
> The assignment was removed as was just assigning a local variable.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Pavel Grunt <pgrunt at redhat.com>
> ---
>  qxldod/driver.cpp | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/qxldod/driver.cpp b/qxldod/driver.cpp
> index bd7971f..4e46d51 100755
> --- a/qxldod/driver.cpp
> +++ b/qxldod/driver.cpp
> @@ -198,11 +198,7 @@ DodRemoveDevice(
>  
>      QxlDod* pQxl = reinterpret_cast<QxlDod*>(pDeviceContext);
>  
> -    if (pQxl)
> -    {
> -        delete pQxl;
> -        pQxl = NULL;
> -    }
> +    delete pQxl;
>  
>      DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
>      return STATUS_SUCCESS;


More information about the Spice-devel mailing list