]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
esx_vi.c: do not call through NULL function pointer
authorJim Meyering <meyering@redhat.com>
Tue, 15 Dec 2009 18:22:31 +0000 (19:22 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 16 Dec 2009 12:39:15 +0000 (13:39 +0100)
* src/esx/esx_vi.c (esxVI_List_CastFromAnyType): For invalid
inputs, fail right away.  Do not "goto failure" where a NULL
input pointer would be dereferenced.

src/esx/esx_vi.c

index 5725b2fa61a2cb69a82f77a4210eeedd1e285695..1138e8c14bd9f9bee685bf56ab71c4b0bb874061 100644 (file)
@@ -935,7 +935,7 @@ esxVI_List_CastFromAnyType(virConnectPtr conn, esxVI_AnyType *anyType,
     if (list == NULL || *list != NULL ||
         castFromAnyTypeFunc == NULL || freeFunc == NULL) {
         ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
-        goto failure;
+        return -1;
     }
 
     if (anyType == NULL) {
@@ -946,7 +946,7 @@ esxVI_List_CastFromAnyType(virConnectPtr conn, esxVI_AnyType *anyType,
         ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
                      "Expecting type to begin with 'ArrayOf' but found '%s'",
                      anyType->other);
-        goto failure;
+        return -1;
     }
 
     for (childNode = anyType->_node->xmlChildrenNode; childNode != NULL;