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

Frediano Ziglio fziglio at redhat.com
Fri Aug 12 11:02:05 UTC 2016


Use delete[] to free an array.
This could potentially lead to memory errors depending
on compiler/library implementation.

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



More information about the Spice-devel mailing list