[Spice-devel] [PATCH 1/5] Use proper delete for _events member

Victor Toso lists at victortoso.com
Fri Aug 12 14:14:33 UTC 2016


Hi,

On Fri, Aug 12, 2016 at 12:02:05PM +0100, Frediano Ziglio wrote:
> Use delete[] to free an array.
> This could potentially lead to memory errors depending
> on compiler/library implementation.
Acked-by: Victor Toso <victortoso at redhat.com>
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  vdservice/vdservice.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/vdservice/vdservice.cpp b/vdservice/vdservice.cpp
> index 89e0dbb..12f7644 100644
> --- a/vdservice/vdservice.cpp
> +++ b/vdservice/vdservice.cpp
> @@ -145,7 +145,7 @@ VDService::~VDService()
>  {
>      CloseHandle(_agent_stop_event);
>      CloseHandle(_control_event);
> -    delete _events;
> +    delete[] _events;
>      delete _log;
>  }
>  
> -- 
> 2.7.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list