src/os/unix/ngx_files.c:350: error: Null Dereference
  pointer `iov` last assigned on line 341 could be null and is dereferenced at line 350, column 13.

src/os/unix/ngx_files.c:333:1: start of procedure ngx_chain_to_iovec()
331. 
332. 
333. static ngx_chain_t *
     ^
334. ngx_chain_to_iovec(ngx_iovec_t *vec, ngx_chain_t *cl)
335. {

src/os/unix/ngx_files.c:341:5: 
339.     struct iovec  *iov;
340. 
341.     iov = NULL;
         ^
342.     prev = NULL;
343.     total = 0;

src/os/unix/ngx_files.c:342:5: 
340. 
341.     iov = NULL;
342.     prev = NULL;
         ^
343.     total = 0;
344.     n = 0;

src/os/unix/ngx_files.c:343:5: 
341.     iov = NULL;
342.     prev = NULL;
343.     total = 0;
         ^
344.     n = 0;
345. 

src/os/unix/ngx_files.c:344:5: 
342.     prev = NULL;
343.     total = 0;
344.     n = 0;
         ^
345. 
346.     for ( /* void */ ; cl; cl = cl->next) {

src/os/unix/ngx_files.c:346:24: Loop condition is true. Entering loop body
344.     n = 0;
345. 
346.     for ( /* void */ ; cl; cl = cl->next) {
                            ^
347.         size = cl->buf->last - cl->buf->pos;
348. 

src/os/unix/ngx_files.c:347:9: 
345. 
346.     for ( /* void */ ; cl; cl = cl->next) {
347.         size = cl->buf->last - cl->buf->pos;
             ^
348. 
349.         if (prev == cl->buf->pos) {

src/os/unix/ngx_files.c:349:13: Taking true branch
347.         size = cl->buf->last - cl->buf->pos;
348. 
349.         if (prev == cl->buf->pos) {
                 ^
350.             iov->iov_len += size;
351. 

src/os/unix/ngx_files.c:350:13: 
348. 
349.         if (prev == cl->buf->pos) {
350.             iov->iov_len += size;
                 ^
351. 
352.         } else {

static ngx_chain_t *
ngx_chain_to_iovec(ngx_iovec_t *vec, ngx_chain_t *cl)
{
    size_t         total, size;
    u_char        *prev;
    ngx_uint_t     n;
    struct iovec  *iov;
    iov = NULL;
    prev = NULL;
    total = 0;
    n = 0;
    for (   ; cl; cl = cl->next) {
        size = cl->buf->last - cl->buf->pos;
        if (prev == cl->buf->pos) {
            iov->iov_len += size;
        } else {
            if (n == vec->nalloc) {
                break;
            }
            iov = &vec->iovs[n++];
            iov->iov_base = (void *) cl->buf->pos;
            iov->iov_len = size;
        }
        prev = cl->buf->pos + size;
        total += size;
    }
    vec->count = n;
    vec->size = total;
    return cl;
}
['static ngx_chain_t *\nngx_chain_to_iovec(ngx_iovec_t *vec, ngx_chain_t *cl)\n{\n    size_t         total, size;\n    u_char        *prev;\n    ngx_uint_t     n;\n    struct iovec  *iov;\n    iov = NULL;\n    prev = NULL;\n    total = 0;\n    n = 0;\n    for (   ; cl; cl = cl->next) {\n        size = cl->buf->last - cl->buf->pos;\n        if (prev == cl->buf->pos) {\n            iov->iov_len += size;\n        } else {\n            if (n == vec->nalloc) {\n                break;\n            }\n            iov = &vec->iovs[n++];\n            iov->iov_base = (void *) cl->buf->pos;\n            iov->iov_len = size;\n        }\n        prev = cl->buf->pos + size;\n        total += size;\n    }\n    vec->count = n;\n    vec->size = total;\n    return cl;\n}']