mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
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: Julio Faracco <jcfaracco@gmail.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
f66f70acbe
commit
692400f446
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user