src/core/ngx_resolver.c:2150: error: Null Dereference
  pointer `dst` last assigned on line 2145 could be null and is dereferenced by call to `memcpy()` at line 2150, column 9.

src/core/ngx_resolver.c:2139:1: start of procedure ngx_resolver_rotate()
2137. 
2138. 
2139. static in_addr_t *
      ^
2140. ngx_resolver_rotate(ngx_resolver_t *r, in_addr_t *src, ngx_uint_t n)
2141. {

src/core/ngx_resolver.c:2145:5: 
2143.     ngx_uint_t   j;
2144. 
2145.     dst = ngx_resolver_alloc(r, n * sizeof(in_addr_t));
          ^
2146. 
2147.     j = ngx_random() % n;

src/core/ngx_resolver.c:2074:1: start of procedure ngx_resolver_alloc()
  2072. 
  2073. 
  2074. static void *
        ^
  2075. ngx_resolver_alloc(ngx_resolver_t *r, size_t size)
  2076. {

src/core/ngx_resolver.c:2081:5: 
  2079.     /* lock alloc mutex */
  2080. 
  2081.     p = ngx_alloc(size, r->log);
            ^
  2082. 
  2083.     /* unlock alloc mutex */

src/os/unix/ngx_alloc.c:17:1: start of procedure ngx_alloc()
    15. 
    16. 
    17. void *
        ^
    18. ngx_alloc(size_t size, ngx_log_t *log)
    19. {

src/os/unix/ngx_alloc.c:22:5: 
    20.     void  *p;
    21. 
    22.     p = malloc(size);
            ^
    23.     if (p == NULL) {
    24.         ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,

src/os/unix/ngx_alloc.c:23:9: Taking true branch
    21. 
    22.     p = malloc(size);
    23.     if (p == NULL) {
                ^
    24.         ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
    25.                       "malloc(%uz) failed", size);

src/os/unix/ngx_alloc.c:24:9: Taking true branch
    22.     p = malloc(size);
    23.     if (p == NULL) {
    24.         ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
                ^
    25.                       "malloc(%uz) failed", size);
    26.     }

src/os/unix/ngx_alloc.c:30:5: 
    28.     ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0, "malloc: %p:%uz", p, size);
    29. 
    30.     return p;
            ^
    31. }
    32. 

src/os/unix/ngx_alloc.c:31:1: return from a call to ngx_alloc
    29. 
    30.     return p;
    31. }
        ^
    32. 
    33. 

src/core/ngx_resolver.c:2085:5: 
  2083.     /* unlock alloc mutex */
  2084. 
  2085.     return p;
            ^
  2086. }
  2087. 

src/core/ngx_resolver.c:2086:1: return from a call to ngx_resolver_alloc
  2084. 
  2085.     return p;
  2086. }
        ^
  2087. 
  2088. 

src/core/ngx_resolver.c:2147:5: 
2145.     dst = ngx_resolver_alloc(r, n * sizeof(in_addr_t));
2146. 
2147.     j = ngx_random() % n;
          ^
2148. 
2149.     if (j == 0) {

src/core/ngx_resolver.c:2149:9: Taking true branch
2147.     j = ngx_random() % n;
2148. 
2149.     if (j == 0) {
              ^
2150.         ngx_memcpy(dst, src, n * sizeof(in_addr_t));
2151.         return dst;

src/core/ngx_resolver.c:2150:9: 
2148. 
2149.     if (j == 0) {
2150.         ngx_memcpy(dst, src, n * sizeof(in_addr_t));
              ^
2151.         return dst;
2152.     }
