diff --git a/src/util/macvtap.c b/src/util/macvtap.c index a020c9058b..7fd6eb54b9 100644 --- a/src/util/macvtap.c +++ b/src/util/macvtap.c @@ -964,7 +964,11 @@ getPhysfnDev(const char *linkdev, */ *vf = PORT_SELF_VF; - *physfndev = (char *)linkdev; + *physfndev = strdup(linkdev); + if (!*physfndev) { + virReportOOMError(); + rc = -1; + } } return rc;