]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fix: passed to proc after free 531/head
authorShchelkunov Artem <a.shchelkunov@ideco.ru>
Fri, 20 Aug 2021 13:06:12 +0000 (18:06 +0500)
committerShchelkunov Artem <a.shchelkunov@ideco.ru>
Fri, 20 Aug 2021 13:06:51 +0000 (18:06 +0500)
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 <github@ideco.ru>

iterator/iter_hints.c

index 2af443d8c6c8d33f3f513752b95bce8fcabd7e1a..5819cfb1703d811c67757d6ba9d03f0429d133ab 100644 (file)
@@ -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: