提交 e786b578 编写于 作者: J John Ferlan 提交者: Peter Krempa

util: Need to check child JSON allocation before use

上级 1130fa31
......@@ -459,8 +459,10 @@ virJSONValuePtr virLockSpacePreExecRestart(virLockSpacePtr lockspace)
virJSONValuePtr resources;
virHashKeyValuePairPtr pairs = NULL, tmp;
if (!object)
if (!object) {
virReportOOMError();
return NULL;
}
virMutexLock(&lockspace->lock);
......@@ -483,6 +485,11 @@ virJSONValuePtr virLockSpacePreExecRestart(virLockSpacePtr lockspace)
virJSONValuePtr owners = NULL;
size_t i;
if (!child) {
virReportOOMError();
goto error;
}
if (virJSONValueArrayAppend(resources, child) < 0) {
virJSONValueFree(child);
goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册