summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2020-03-23 09:13:20 +0100
committerAndreas Schneider <asn@samba.org>2020-03-23 09:13:20 +0100
commit43578b9a28184086cbdef4a257db808e2992b162 (patch)
tree348f2c5ef89cfdd17b24824fe441279031fb3589 /tests
parent7bced01e89a16e673794e83dc984967aaddb558c (diff)
downloadsocket_wrapper-43578b9a28184086cbdef4a257db808e2992b162.tar.gz
socket_wrapper-43578b9a28184086cbdef4a257db808e2992b162.tar.xz
socket_wrapper-43578b9a28184086cbdef4a257db808e2992b162.zip
tests: Fix a coverty warning in echo_srv
CID #288875 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/echo_srv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/echo_srv.c b/tests/echo_srv.c
index 01e3325..93778f2 100644
--- a/tests/echo_srv.c
+++ b/tests/echo_srv.c
@@ -920,7 +920,9 @@ int main(int argc, char **argv)
}
echo(sock, &opts);
- close(sock);
+ if (sock >= 0) {
+ close(sock);
+ }
if (opts.daemon && opts.pidfile != NULL) {
unlink(opts.pidfile);