提交 4a7acedd 编写于 作者: D Daniel P. Berrange

Fix free of unitialized data upon PCI open fail

上级 1795bfe4
...@@ -834,10 +834,8 @@ pciReadDeviceID(pciDevice *dev, const char *id_name) ...@@ -834,10 +834,8 @@ pciReadDeviceID(pciDevice *dev, const char *id_name)
dev->name, id_name); dev->name, id_name);
/* ID string is '0xNNNN\n' ... i.e. 7 bytes */ /* ID string is '0xNNNN\n' ... i.e. 7 bytes */
if (virFileReadAll(path, 7, &id_str) < 7) { if (virFileReadAll(path, 7, &id_str) < 0)
VIR_FREE(id_str);
return NULL; return NULL;
}
/* Check for 0x suffix */ /* Check for 0x suffix */
if (id_str[0] != '0' || id_str[1] != 'x') { if (id_str[0] != '0' || id_str[1] != 'x') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册