]> xenbits.xensource.com Git - libvirt.git/commitdiff
esx: drop dead code to silence Coverity
authorEric Blake <eblake@redhat.com>
Thu, 13 Oct 2011 22:06:38 +0000 (16:06 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 14 Oct 2011 14:51:26 +0000 (08:51 -0600)
Coverity detected that the only way to get to the cleanup label
is if objectSpec had been successfully allocated, so the null
check was dead code.

* src/esx/esx_vi.c (esxVI_LookupObjectContentByType): Drop
redundant null check.

src/esx/esx_vi.c

index 4a8c709fac0b0e6199bd8958a32db5a1eff22a73..8bcd76c7e43dfeb786bea0d7aea9f7f1b2e4c887 100644 (file)
@@ -1763,11 +1763,8 @@ esxVI_LookupObjectContentByType(esxVI_Context *ctx,
      * Remove values given by the caller from the data structures to prevent
      * them from being freed by the call to esxVI_PropertyFilterSpec_Free().
      */
-    if (objectSpec != NULL) {
-        objectSpec->obj = NULL;
-        objectSpec->selectSet = NULL;
-    }
-
+    objectSpec->obj = NULL;
+    objectSpec->selectSet = NULL;
     if (propertySpec != NULL) {
         propertySpec->type = NULL;
         propertySpec->pathSet = NULL;