提交 bb889529 编写于 作者: E Eric Blake

command: avoid leak on failure

Detected by Coverity.  While it is possible on OOM condition, as
well as with bad code that passes binary == NULL, it is unlikely
to be encountered in the wild.

* src/util/command.c (virCommandNewArgList): Don't leak memory.
上级 6d68e0df
......@@ -142,7 +142,7 @@ virCommandNewArgList(const char *binary, ...)
const char *arg;
if (!cmd || cmd->has_error)
return NULL;
return cmd;
va_start(list, binary);
while ((arg = va_arg(list, const char *)) != NULL)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册