From: Andrea Bolognani Date: Wed, 25 May 2016 08:27:12 +0000 (+0200) Subject: pci: Initialize return location in virPCIGetPhysicalFunction() X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=12b28f1bf834e41406d5eb8b440f45f2e599be67;p=libvirt.git pci: Initialize return location in virPCIGetPhysicalFunction() Just an extra precaution in case the function returns early due to an OOM error. --- diff --git a/src/util/virpci.c b/src/util/virpci.c index 3d18bb3afc..ca117db0c1 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -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;