From: Shchelkunov Artem Date: Fri, 20 Aug 2021 13:06:12 +0000 (+0500) Subject: Fix: passed to proc after free X-Git-Tag: release-1.14.0rc1~64^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F531%2Fhead;p=thirdparty%2Funbound.git Fix: passed to proc after free Found by static analyzer svace Static analyzer message: Pointer 'dp' is passed to a function at iter_hints.c:401 after the referenced memory was deallocated at iter_hints.c:174 by passing as 3rd parameter to function 'hints_insert' at iter_hints.c:398. on-behalf-of: @ideco-team --- diff --git a/iterator/iter_hints.c b/iterator/iter_hints.c index 2af443d8c..5819cfb17 100644 --- a/iterator/iter_hints.c +++ b/iterator/iter_hints.c @@ -397,10 +397,10 @@ read_root_hints(struct iter_hints* hints, char* fname) delegpt_free_mlc(dp); return 1; } + delegpt_log(VERB_QUERY, dp); if(!hints_insert(hints, c, dp, 0)) { return 0; } - delegpt_log(VERB_QUERY, dp); return 1; stop_read: