]> xenbits.xensource.com Git - libvirt.git/commitdiff
pci: Initialize return location in virPCIGetPhysicalFunction()
authorAndrea Bolognani <abologna@redhat.com>
Wed, 25 May 2016 08:27:12 +0000 (10:27 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Wed, 25 May 2016 08:38:01 +0000 (10:38 +0200)
Just an extra precaution in case the function returns early
due to an OOM error.

src/util/virpci.c

index 3d18bb3afcbad1c1d76b14178b6ae40f6d642845..ca117db0c1a5470fe61ba2d5a1b62cae14a31d06 100644 (file)
@@ -2487,6 +2487,8 @@ virPCIGetPhysicalFunction(const char *vf_sysfs_path,
 {
     char *device_link = NULL;
 
+    *pf = NULL;
+
     if (virBuildPath(&device_link, vf_sysfs_path, "physfn") == -1) {
         virReportOOMError();
         return -1;