From: Eric Blake Date: Thu, 13 Oct 2011 22:06:38 +0000 (-0600) Subject: esx: drop dead code to silence Coverity X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1518042;p=libvirt.git esx: drop dead code to silence Coverity 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. --- diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c index 4a8c709fac..8bcd76c7e4 100644 --- a/src/esx/esx_vi.c +++ b/src/esx/esx_vi.c @@ -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;