tests: Fix resouce leak in echo_srv tcp handling
authorAndreas Schneider <asn@samba.org>
Fri, 4 May 2018 06:01:29 +0000 (08:01 +0200)
committerAndreas Schneider <asn@samba.org>
Fri, 4 May 2018 06:41:55 +0000 (08:41 +0200)
CID 175587

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
tests/echo_srv.c

index 2f877f4e24f7f1914aa2c309dcca79e5ce1f386a..771904a31fa5bf3c2c39f6c7d6f2e28c304dca73 100644 (file)
@@ -534,9 +534,8 @@ static void echo_tcp(int sock)
             }
             close(s);
             exit(0);
-        } else {
-            close(s);
         }
+        close(s);
     }
 
 done: