From 9366ca769f2f6d6ede4e12fe919179f4a409a9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Fri, 27 Sep 2019 08:48:06 +0200 Subject: [PATCH] bin/dig/dighost.c: Fix REQUIRE(!= NULL) condition after the variable has been dereferenced --- bin/dig/dighost.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 5e24af65e5..e2018a7af7 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -2045,6 +2045,9 @@ setup_lookup(dig_lookup_t *lookup) { char cookiebuf[256]; char *origin = NULL; char *textname = NULL; + + REQUIRE(lookup != NULL); + #ifdef HAVE_LIBIDN2 char idn_origin[MXNAME], idn_textname[MXNAME]; @@ -2053,7 +2056,6 @@ setup_lookup(dig_lookup_t *lookup) { check_result(result, "dns_name_settotextfilter"); #endif /* HAVE_LIBIDN2 */ - REQUIRE(lookup != NULL); INSIST(!free_now); debug("setup_lookup(%p)", lookup);