提交 692400f4 编写于 作者: J Julio Faracco 提交者: Erik Skultety

util: Fix uninitalized variable to avoid garbage

This commit fixes an unitialized variable to avoid garbage value
when virNetDevBridgeGet method returns error. When, that method fails
before initialize 'val' variable, it can cause problems related to
that.
Signed-off-by: NJulio Faracco <jcfaracco@gmail.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 f66f70ac
......@@ -760,7 +760,7 @@ int virNetDevBridgeGetSTP(const char *brname,
bool *enabled)
{
int ret = -1;
unsigned long val;
unsigned long val = 0;
ret = virNetDevBridgeGet(brname, "stp_state", &val);
*enabled = val ? true : false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册