tests: Check for valid fd in torture_setup_resolv_conf()
authorAndreas Schneider <asn@samba.org>
Mon, 23 Mar 2020 07:41:53 +0000 (08:41 +0100)
committerAndreas Schneider <asn@samba.org>
Mon, 23 Mar 2020 07:41:53 +0000 (08:41 +0100)
CID #68262

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
tests/torture.c

index f6de6d993f9336656ab72c101ca4d3b1f0c54616..5bb9f0c0573a13c4a02331bc8d76b03d9b367066 100644 (file)
@@ -163,6 +163,7 @@ static char *torture_setup_resolv_conf(const char **nameservers, size_t num_ns)
        path = strdup(RWRAP_RESOLV_CONF_TMPL);
        assert_non_null(path);
        rc_fd = mkstemp(path);
+       assert_return_code(rc_fd, errno);
        assert_non_null(path);
        resolv_conf = fdopen(rc_fd, "a");
        assert_non_null(resolv_conf);