]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
esx_util.c: avoid NULL deref for invalid inputs
authorJim Meyering <meyering@redhat.com>
Tue, 15 Dec 2009 18:08:49 +0000 (19:08 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 16 Dec 2009 12:39:15 +0000 (13:39 +0100)
* src/esx/esx_util.c (esxUtil_ParseDatastoreRelatedPath): Return
right away for invalid inputs, rather than using them (which would
dereference NULL pointers) in clean-up code.

src/esx/esx_util.c

index 3e539217b14c2b4f6d4037da0d6493cf79b3322b..35a48e0898f16c4e9a036d358b1a1ea6838246f3 100644 (file)
@@ -277,7 +277,7 @@ esxUtil_ParseDatastoreRelatedPath(virConnectPtr conn,
         directoryName == NULL || *directoryName != NULL ||
         fileName == NULL || *fileName != NULL) {
         ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
-        goto failure;
+        return -1;
     }
 
     /*