diff --git a/peertalk/PTUSBHub.m b/peertalk/PTUSBHub.m index eb8a838..cad08e4 100644 --- a/peertalk/PTUSBHub.m +++ b/peertalk/PTUSBHub.m @@ -352,6 +352,7 @@ - (BOOL)openOnQueue:(dispatch_queue_t)queue error:(NSError**)error onEnd:(void(^ socklen_t socklen = sizeof(addr); if (connect(fd, (struct sockaddr*)&addr, socklen) == -1) { if (error) *error = [[NSError alloc] initWithDomain:NSPOSIXErrorDomain code:errno userInfo:nil]; + close(fd); return NO; }