diff --git a/router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java b/router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java index f6b4d3478682a3c24bdc9cb2d50408eb4a772ae0..0699d3ff4d04b0df98485f266c3c08f738161d00 100644 --- a/router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java +++ b/router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java @@ -249,6 +249,8 @@ class BuildHandler { int record = order.indexOf(Integer.valueOf(i)); if (record < 0) { _log.error("Bad status index " + i); + // don't leak + _exec.buildComplete(cfg, cfg.getTunnelPool()); return; } int howBad = statuses[record]; @@ -294,9 +296,9 @@ class BuildHandler { _context.messageHistory().tunnelParticipantRejected(peer, "peer rejected after " + rtt + " with " + howBad + ": " + cfg.toString()); } } + _exec.buildComplete(cfg, cfg.getTunnelPool()); if (allAgree) { // wikked, completely build - _exec.buildComplete(cfg, cfg.getTunnelPool()); if (cfg.isInbound()) _context.tunnelDispatcher().joinInbound(cfg); else @@ -313,7 +315,6 @@ class BuildHandler { _context.statManager().addRateData("tunnel.buildClientSuccess", rtt, rtt); } else { // someone is no fun - _exec.buildComplete(cfg, cfg.getTunnelPool()); if (cfg.getDestination() == null) _context.statManager().addRateData("tunnel.buildExploratoryReject", rtt, rtt); else @@ -322,6 +323,8 @@ class BuildHandler { } else { if (_log.shouldLog(Log.WARN)) _log.warn(msg.getUniqueId() + ": Tunnel reply could not be decrypted for tunnel " + cfg); + // don't leak + _exec.buildComplete(cfg, cfg.getTunnelPool()); } }