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

Frediano Ziglio fziglio at redhat.com
Wed Apr 12 13:19:48 UTC 2017


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>
---
 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;
-- 
2.9.3



More information about the Spice-devel mailing list