From: Andreas Schneider Date: Mon, 21 Oct 2019 06:59:57 +0000 (+0200) Subject: tests: Fix coverity warning that sock could be negative X-Git-Tag: resolv_wrapper-1.1.6~20 X-Git-Url: http://git.samba.org/?p=resolv_wrapper.git;a=commitdiff_plain;h=ae57d39043a09c2f7cafae5516486b5b460b352b tests: Fix coverity warning that sock could be negative CID 263708 Signed-off-by: Andreas Schneider Reviewed-by: Ralph Boehme --- diff --git a/tests/dns_srv.c b/tests/dns_srv.c index 94e5c3d..868dee4 100644 --- a/tests/dns_srv.c +++ b/tests/dns_srv.c @@ -633,8 +633,10 @@ int main(int argc, char **argv) } } - dns(sock); - close(sock); + if (sock != -1) { + dns(sock); + close(sock); + } if (opts.daemon) { unlink(opts.pidfile);