mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
virnetworkobj: Free retval of virNetworkObjGetPortStatusDir()
The virNetworkObjGetPortStatusDir() function allocates a memory to construct a path. None of the callers free it leading to a memleak. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
975b004d07
commit
37d8d6b98d
@ -1627,7 +1627,7 @@ virNetworkObjAddPort(virNetworkObjPtr net,
|
||||
{
|
||||
int ret = -1;
|
||||
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
||||
char *dir = NULL;
|
||||
VIR_AUTOFREE(char *) dir = NULL;
|
||||
|
||||
virUUIDFormat(portdef->uuid, uuidstr);
|
||||
|
||||
@ -1717,7 +1717,7 @@ int
|
||||
virNetworkObjDeleteAllPorts(virNetworkObjPtr net,
|
||||
const char *stateDir)
|
||||
{
|
||||
char *dir;
|
||||
VIR_AUTOFREE(char *) dir = NULL;
|
||||
DIR *dh = NULL;
|
||||
struct dirent *de;
|
||||
int rc;
|
||||
@ -1843,7 +1843,7 @@ static int
|
||||
virNetworkObjLoadAllPorts(virNetworkObjPtr net,
|
||||
const char *stateDir)
|
||||
{
|
||||
char *dir;
|
||||
VIR_AUTOFREE(char *) dir = NULL;
|
||||
DIR *dh = NULL;
|
||||
struct dirent *de;
|
||||
int ret = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user