From b5d8748db478d22fe21af8558a25f648bd33d086 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 6 Jul 2015 17:48:39 -0700 Subject: [PATCH] fix crash on invalid udp tracker response --- lib/udp-tracker.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/udp-tracker.js b/lib/udp-tracker.js index 0f0fb25..1ad5f3c 100644 --- a/lib/udp-tracker.js +++ b/lib/udp-tracker.js @@ -82,6 +82,7 @@ UDPTracker.prototype._request = function (opts) { var socket = dgram.createSocket('udp4') var cleanup = function () { + if (!socket) return self._cleanupFns.splice(self._cleanupFns.indexOf(cleanup), 1) if (timeout) { clearTimeout(timeout)