]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
lxc: Resolve Coverity warning
authorJohn Ferlan <jferlan@redhat.com>
Mon, 22 Jul 2013 20:59:41 +0000 (16:59 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 23 Jul 2013 23:04:48 +0000 (19:04 -0400)
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

index 02ac5d44d4ade589ec7b931b38bd89a4f8b6d9f3..06ead9fafd9dd776f32a2e0407f449f7a7f5565b 100644 (file)
@@ -75,7 +75,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;
     }