fix crash on invalid udp tracker response

This commit is contained in:
Feross Aboukhadijeh 2015-07-06 17:48:39 -07:00
parent 7ea2a138d3
commit b5d8748db4

View File

@ -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)