crypto/bio/b_addr.c:81: error: NULL_DEREFERENCE
  pointer `ret` last assigned on line 79 could be null and is dereferenced at line 81, column 5.
Showing all 18 steps of the trace


crypto/bio/b_addr.c:77:1: start of procedure BIO_ADDR_new()
75.    */
76.   
77. > BIO_ADDR *BIO_ADDR_new(void)
78.   {
79.       BIO_ADDR *ret = OPENSSL_zalloc(sizeof(*ret));

crypto/bio/b_addr.c:79:5: 
77.   BIO_ADDR *BIO_ADDR_new(void)
78.   {
79. >     BIO_ADDR *ret = OPENSSL_zalloc(sizeof(*ret));
80.   
81.       ret->sa.sa_family = AF_UNSPEC;

crypto/mem.c:159:1: start of procedure CRYPTO_zalloc()
  157.   }
  158.   
  159. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  160.   {
  161.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:161:5: 
  159.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  160.   {
  161. >     void *ret = CRYPTO_malloc(num, file, line);
  162.   
  163.       if (ret != NULL)

crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
    117.   }
    118.   
    119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    120.   {
    121.       void *ret = NULL;

crypto/mem.c:121:5: 
    119.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    120.   {
    121. >     void *ret = NULL;
    122.   
    123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:123:9: Taking false branch
    121.       void *ret = NULL;
    122.   
    123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    124.           return malloc_impl(num, file, line);
    125.   

crypto/mem.c:126:9: Taking false branch
    124.           return malloc_impl(num, file, line);
    125.   
    126.       if (num <= 0)
                   ^
    127.           return NULL;
    128.   

crypto/mem.c:129:5: 
    127.           return NULL;
    128.   
    129. >     allow_customize = 0;
    130.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    131.       if (call_malloc_debug) {

crypto/mem.c:139:5: 
    137.       }
    138.   #else
    139. >     (void)file;
    140.       (void)line;
    141.       ret = malloc(num);

crypto/mem.c:140:5: 
    138.   #else
    139.       (void)file;
    140. >     (void)line;
    141.       ret = malloc(num);
    142.   #endif

crypto/mem.c:141:5: 
    139.       (void)file;
    140.       (void)line;
    141. >     ret = malloc(num);
    142.   #endif
    143.   

crypto/mem.c:156:5: 
    154.   #endif
    155.   
    156. >     return ret;
    157.   }
    158.   

crypto/mem.c:157:1: return from a call to CRYPTO_malloc
    155.   
    156.       return ret;
    157. > }
    158.   
    159.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:163:9: Taking false branch
  161.       void *ret = CRYPTO_malloc(num, file, line);
  162.   
  163.       if (ret != NULL)
                 ^
  164.           memset(ret, 0, num);
  165.       return ret;

crypto/mem.c:165:5: 
  163.       if (ret != NULL)
  164.           memset(ret, 0, num);
  165. >     return ret;
  166.   }
  167.   

crypto/mem.c:166:1: return from a call to CRYPTO_zalloc
  164.           memset(ret, 0, num);
  165.       return ret;
  166. > }
  167.   
  168.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/bio/b_addr.c:81:5: 
79.       BIO_ADDR *ret = OPENSSL_zalloc(sizeof(*ret));
80.   
81. >     ret->sa.sa_family = AF_UNSPEC;
82.       return ret;
83.   }

BIO_ADDR *BIO_ADDR_new(void)
{
    BIO_ADDR *ret = OPENSSL_zalloc(sizeof(*ret));
    ret->sa.sa_family = AF_UNSPEC;
    return ret;
}
['BIO_ADDR *BIO_ADDR_new(void)\n{\n    BIO_ADDR *ret = OPENSSL_zalloc(sizeof(*ret));\n    ret->sa.sa_family = AF_UNSPEC;\n    return ret;\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)file;\n    (void)line;\n    ret = malloc(num);\n#endif\n#ifndef OPENSSL_CPUID_OBJ\n    if (ret && (num > 2048)) {\n        extern unsigned char cleanse_ctr;\n        ((unsigned char *)ret)[0] = cleanse_ctr;\n    }\n#endif\n    return ret;\n}']