提交 57bb725a 编写于 作者: J Jiri Denemark

qemu: Avoid NULL dereference in qemuSharedDiskEntryFree

At least one caller may call qemuSharedDiskEntryFree with NULL as the
first argument. Let's make the function similar to other *Free functions
and do nothing in such case.
上级 11677e08
......@@ -1045,6 +1045,9 @@ qemuSharedDiskEntryFree(void *payload, const void *name ATTRIBUTE_UNUSED)
qemuSharedDiskEntryPtr entry = payload;
size_t i;
if (!entry)
return;
for (i = 0; i < entry->ref; i++) {
VIR_FREE(entry->domains[i]);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册