[libvirt] [PATCH 1/3] lxc: Resolve Coverity warning

John Ferlan jferlan at redhat.com
Tue Jul 23 15:59:29 UTC 2013


Commit 'c8695053' resulted in the following:

Coverity error seen in the output:
    ERROR: REVERSE_INULL
    FUNCTION: lxcProcessAutoDestroy

Due to the 'dom' being checked before 'dom->persistent' since 'dom'
is already dereferenced prior to that.
---
 src/lxc/lxc_process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index 5b83ccb..5c4f8c8 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -74,7 +74,7 @@ lxcProcessAutoDestroy(virDomainObjPtr dom,
                                      VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
     priv->doneStopEvent = true;
 
-    if (dom && !dom->persistent) {
+    if (!dom->persistent) {
         virDomainObjListRemove(driver->domains, dom);
         dom = NULL;
     }
-- 
1.8.1.4




More information about the libvir-list mailing list