提交 cce545dd 编写于 作者: D Daniel P. Berrangé

conf: fix leak of directory handle when loading network ports

Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 0ce813a8
......@@ -1718,7 +1718,7 @@ virNetworkObjDeleteAllPorts(virNetworkObjPtr net,
const char *stateDir)
{
char *dir;
DIR *dh;
DIR *dh = NULL;
struct dirent *de;
int rc;
int ret = -1;
......@@ -1750,6 +1750,7 @@ virNetworkObjDeleteAllPorts(virNetworkObjPtr net,
ret = 0;
cleanup:
VIR_DIR_CLOSE(dh);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册