mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
interface: avoid memory leak on parse error
Detected by Coverity. Unlikely to hit unless the file contents were corrupted. * src/util/interface.c (ifaceRestoreMacAddress): Plug leak.
This commit is contained in:
parent
e07e9a9456
commit
9e8b7c1523
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* interface.c: interface support functions
|
||||
*
|
||||
* Copyright (C) 2011 Red Hat, Inc.
|
||||
* Copyright (C) 2010 IBM Corp.
|
||||
* Copyright (C) 2010 Stefan Berger
|
||||
*
|
||||
@ -1100,6 +1101,7 @@ ifaceRestoreMacAddress(const char *linkdev,
|
||||
ifaceError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Cannot parse MAC address from '%s'"),
|
||||
oldmacname);
|
||||
VIR_FREE(macstr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user