commit 72aa1646f69fc738b8df2afaa1b8f4ae9df4c68f
parent 53c3963497dbf82c3f4f085d5cd97b8b0941c29e
Author: Laslo Hunhold <dev@frign.de>
Date:   Fri, 23 Feb 2018 22:40:47 +0100
If fork fails, close the incoming socket
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/main.c b/main.c
@@ -237,13 +237,13 @@ main(int argc, char *argv[])
 
 			/* fork and handle */
 			switch ((spid = fork())) {
-			case -1:
-				warn("fork:");
-				continue;
 			case 0:
 				serve(infd, &in_sa);
 				exit(0);
 				break;
+			case -1:
+				warn("fork:");
+				/* fallthrough */
 			default:
 				/* close the connection in the parent */
 				close(infd);