From 18e39f618f5bd1cef7ff9979930dc17daf93a857 Mon Sep 17 00:00:00 2001 From: Chrishon-Meta <100313266+Chrishon-Meta@users.noreply.github.com> Date: Wed, 27 Apr 2022 13:27:57 -0400 Subject: [PATCH] Prevent starting processes indefinitely. Close the socket to prevent the system from starting infinite processes. --- peertalk/PTUSBHub.m | 1 + 1 file changed, 1 insertion(+) 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; }