diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c index 1c6f6ffcba..2359e8fe31 100644 --- a/src/esx/esx_vi.c +++ b/src/esx/esx_vi.c @@ -1390,7 +1390,11 @@ esxVI_BuildSelectSet(esxVI_SelectionSpec **selectSet, esxVI_SelectionSpec *selectionSpec = NULL; const char *currentSelectSetName = NULL; - if (selectSet == NULL || *selectSet != NULL) { + if (selectSet == NULL) { + /* + * Don't check for *selectSet != NULL here because selectSet is a list + * and might contain items already. This function appends to selectSet. + */ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument")); return -1; }