From 12b28f1bf834e41406d5eb8b440f45f2e599be67 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Wed, 25 May 2016 10:27:12 +0200 Subject: [PATCH] pci: Initialize return location in virPCIGetPhysicalFunction() Just an extra precaution in case the function returns early due to an OOM error. --- src/util/virpci.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- GitLab