src/core/ngx_resolver.c:198: error: Use After Free
  call to `ngx_rbtree_min()` eventually accesses memory that was invalidated by call to `free()` on line 214 indirectly during the call to `ngx_resolver_free_node()`.

src/core/ngx_resolver.c:190:1: invalidation part of the trace starts here
188. 
189. 
190. static void
     ^
191. ngx_resolver_cleanup_tree(ngx_resolver_t *r, ngx_rbtree_t *tree)
192. {

src/core/ngx_resolver.c:190:1: parameter `tree` of ngx_resolver_cleanup_tree
  188. 
  189. 
  190. static void
       ^
  191. ngx_resolver_cleanup_tree(ngx_resolver_t *r, ngx_rbtree_t *tree)
  192. {

src/core/ngx_resolver.c:198:38: passed as argument to `ngx_rbtree_min`
  196.     while (tree->root != tree->sentinel) {
  197. 
  198.         rn = (ngx_resolver_node_t *) ngx_rbtree_min(tree->root, tree->sentinel);
                                            ^
  199. 
  200.         ngx_queue_remove(&rn->queue);

src/core/ngx_resolver.c:198:38: return from call to `ngx_rbtree_min`
  196.     while (tree->root != tree->sentinel) {
  197. 
  198.         rn = (ngx_resolver_node_t *) ngx_rbtree_min(tree->root, tree->sentinel);
                                            ^
  199. 
  200.         ngx_queue_remove(&rn->queue);

src/core/ngx_resolver.c:198:9: assigned
  196.     while (tree->root != tree->sentinel) {
  197. 
  198.         rn = (ngx_resolver_node_t *) ngx_rbtree_min(tree->root, tree->sentinel);
               ^
  199. 
  200.         ngx_queue_remove(&rn->queue);

src/core/ngx_resolver.c:214:9: when calling `ngx_resolver_free_node` here
  212.         ngx_rbtree_delete(tree, &rn->node);
  213. 
  214.         ngx_resolver_free_node(r, rn);
               ^
  215.     }
  216. }

src/core/ngx_resolver.c:1959:1: parameter `rn` of ngx_resolver_free_node
    1957. 
    1958. 
    1959. static void
          ^
    1960. ngx_resolver_free_node(ngx_resolver_t *r, ngx_resolver_node_t *rn)
    1961. {

src/core/ngx_resolver.c:1980:5: when calling `ngx_resolver_free_locked` here
    1978.     }
    1979. 
    1980.     ngx_resolver_free_locked(r, rn);
              ^
    1981. 
    1982.     /* unlock alloc mutex */

src/core/ngx_resolver.c:2027:1: parameter `p` of ngx_resolver_free_locked
      2025. 
      2026. 
      2027. static void
            ^
      2028. ngx_resolver_free_locked(ngx_resolver_t *r, void *p)
      2029. {

src/core/ngx_resolver.c:2030:5: was invalidated by call to `free()`
      2028. ngx_resolver_free_locked(ngx_resolver_t *r, void *p)
      2029. {
      2030.     ngx_free(p);
                ^
      2031. }
      2032. 

src/core/ngx_resolver.c:190:1: use-after-lifetime part of the trace starts here
188. 
189. 
190. static void
     ^
191. ngx_resolver_cleanup_tree(ngx_resolver_t *r, ngx_rbtree_t *tree)
192. {

src/core/ngx_resolver.c:190:1: parameter `tree` of ngx_resolver_cleanup_tree
  188. 
  189. 
  190. static void
       ^
  191. ngx_resolver_cleanup_tree(ngx_resolver_t *r, ngx_rbtree_t *tree)
  192. {

src/core/ngx_resolver.c:198:38: when calling `ngx_rbtree_min` here
  196.     while (tree->root != tree->sentinel) {
  197. 
  198.         rn = (ngx_resolver_node_t *) ngx_rbtree_min(tree->root, tree->sentinel);
                                            ^
  199. 
  200.         ngx_queue_remove(&rn->queue);

src/core/ngx_rbtree.h:72:1: parameter `node` of ngx_rbtree_min
    70. 
    71. 
    72. static ngx_inline ngx_rbtree_node_t *
        ^
    73. ngx_rbtree_min(ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel)
    74. {

src/core/ngx_rbtree.h:75:12: invalid access occurs here
    73. ngx_rbtree_min(ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel)
    74. {
    75.     while (node->left != sentinel) {
                   ^
    76.         node = node->left;
    77.     }
