提交 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, ...@@ -1718,7 +1718,7 @@ virNetworkObjDeleteAllPorts(virNetworkObjPtr net,
const char *stateDir) const char *stateDir)
{ {
char *dir; char *dir;
DIR *dh; DIR *dh = NULL;
struct dirent *de; struct dirent *de;
int rc; int rc;
int ret = -1; int ret = -1;
...@@ -1750,6 +1750,7 @@ virNetworkObjDeleteAllPorts(virNetworkObjPtr net, ...@@ -1750,6 +1750,7 @@ virNetworkObjDeleteAllPorts(virNetworkObjPtr net,
ret = 0; ret = 0;
cleanup: cleanup:
VIR_DIR_CLOSE(dh);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册