6717680: LdapCtx does not close the connection if initialization fails

Reviewed-by: vinnie, xuelei
This commit is contained in:
Weijun Wang 2008-12-30 10:42:45 +08:00
parent 14b56dc3a0
commit e33cec202f

View File

@ -302,7 +302,16 @@ final public class LdapCtx extends ComponentDirContext
schemaTrees = new Hashtable(11, 0.75f);
initEnv();
connect(false);
try {
connect(false);
} catch (NamingException e) {
try {
close();
} catch (Exception e2) {
// Nothing
}
throw e;
}
}
LdapCtx(LdapCtx existing, String newDN) throws NamingException {