aboutsummaryrefslogtreecommitdiff
path: root/tests/echo_srv.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2014-04-10 10:28:46 +0200
committerAndreas Schneider <asn@samba.org>2014-04-14 15:28:52 +0200
commit2254633003312b1f7462a408480483a2ec58d18a (patch)
treeeea30aee55b0bfe6b0ce4793a3cdbcc29fd6d79a /tests/echo_srv.c
parent03726df0861c1a4f85e938a77616ac8780aa4760 (diff)
downloadsocket_wrapper-2254633003312b1f7462a408480483a2ec58d18a.tar.gz
socket_wrapper-2254633003312b1f7462a408480483a2ec58d18a.tar.xz
socket_wrapper-2254633003312b1f7462a408480483a2ec58d18a.zip
echo_srv: Fix resource leak of sock.
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Simo Sorce <idra@samba.org>
Diffstat (limited to 'tests/echo_srv.c')
-rw-r--r--tests/echo_srv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/echo_srv.c b/tests/echo_srv.c
index 70d9a84..537de08 100644
--- a/tests/echo_srv.c
+++ b/tests/echo_srv.c
@@ -182,6 +182,7 @@ static int setup_srv(struct echo_srv_opts *opts, int *_sock)
ret = listen(sock, BACKLOG);
if (ret == -1) {
ret = errno;
+ close(sock);
perror("listen");
return ret;
}