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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/23/13 17:59, John Ferlan wrote:
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;
      }


ACK, dom is indeed dereferenced before, thus it will not crash here.

Peter

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]