From: Andreas Schneider Date: Mon, 23 Mar 2020 07:41:53 +0000 (+0100) Subject: tests: Check for valid fd in torture_setup_resolv_conf() X-Git-Tag: resolv_wrapper-1.1.6~3 X-Git-Url: http://git.samba.org/?p=resolv_wrapper.git;a=commitdiff_plain;h=eb8938a9020129a0ff898d3ba402a275640f6fc8 tests: Check for valid fd in torture_setup_resolv_conf() CID #68262 Signed-off-by: Andreas Schneider Reviewed-by: Stefan Metzmacher --- diff --git a/tests/torture.c b/tests/torture.c index f6de6d9..5bb9f0c 100644 --- a/tests/torture.c +++ b/tests/torture.c @@ -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);