diff --git a/src/util/virpci.c b/src/util/virpci.c index a0da1cd005e80d8f2fa3ee0b74e24df0bf943da2..85cd6948d721ea2f48cad5d50b26d7b43f5c8b48 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -2026,8 +2026,8 @@ virPCIGetVirtualFunctions(const char *sysfs_path, continue; } - if (VIR_ALLOC_N(*virtual_functions, - *num_virtual_functions + 1) < 0) { + if (VIR_REALLOC_N(*virtual_functions, + *num_virtual_functions + 1) < 0) { virReportOOMError(); VIR_FREE(config_addr); goto error;