提交 37d8d6b9 编写于 作者: M Michal Privoznik

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: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 975b004d
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册