提交 af3262e2 编写于 作者: J John Ferlan 提交者: Ján Tomko

rpc: Avoid resource leak of 'socks' if any object append fails

上级 4f85cfdf
......@@ -356,9 +356,6 @@ virJSONValuePtr virNetServerServicePreExecRestart(virNetServerServicePtr svc)
if (!object)
return NULL;
if (!(socks = virJSONValueNewArray()))
goto error;
if (virJSONValueObjectAppendNumberInt(object, "auth", svc->auth) < 0)
goto error;
if (virJSONValueObjectAppendBoolean(object, "readonly", svc->readonly) < 0)
......@@ -366,6 +363,9 @@ virJSONValuePtr virNetServerServicePreExecRestart(virNetServerServicePtr svc)
if (virJSONValueObjectAppendNumberUint(object, "nrequests_client_max", svc->nrequests_client_max) < 0)
goto error;
if (!(socks = virJSONValueNewArray()))
goto error;
if (virJSONValueObjectAppend(object, "socks", socks) < 0) {
virJSONValueFree(socks);
goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册