提交 18b3096c 编写于 作者: C Chris Lalancette

Fix a memory leak in the node_device_udev code

We were over-writing a pointer without freeing it in
case of a disk device, leading to a memory leak.
Signed-off-by: NChris Lalancette <clalance@redhat.com>
上级 50250aba
......@@ -815,13 +815,6 @@ static int udevProcessDisk(struct udev_device *device,
union _virNodeDevCapData *data = &def->caps->data;
int ret = 0;
data->storage.drive_type = strdup("disk");
if (data->storage.drive_type == NULL) {
virReportOOMError();
ret = -1;
goto out;
}
if (udevGetUint64SysfsAttr(device,
"size",
&data->storage.num_blocks) == PROPERTY_ERROR) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册