[Spice-devel] [PATCH 2/5] client: match delete[] with new[]

Alon Levy alevy at redhat.com
Mon Jul 18 07:52:18 PDT 2011


On Fri, Jul 08, 2011 at 12:17:29PM +0200, Christophe Fergeau wrote:
> vinfo in x11/platform.cpp is allocated using new[] so it needs to
> be freed with delete[]

ACK.

> ---
>  client/x11/platform.cpp |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
> index 7c31058..910d61e 100644
> --- a/client/x11/platform.cpp
> +++ b/client/x11/platform.cpp
> @@ -2881,7 +2881,7 @@ static void cleanup(void)
>          for (i = 0; i < ScreenCount(x_display); ++i) {
>              XFree(vinfo[i]);
>          }
> -        delete vinfo;
> +        delete[] vinfo;
>          vinfo = NULL;
>      }
>  #ifdef USE_OPENGL
> -- 
> 1.7.6
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list