crypto/bio/b_addr.c:623: error: MEMORY_LEAK
  memory dynamically allocated to `*bai` by call to `CRYPTO_zalloc()` at line 594, column 12 is not reachable after line 623, column 9.
Showing all 31 steps of the trace


crypto/bio/b_addr.c:587:1: start of procedure addrinfo_wrap()
585.    * only happens if a memory allocation error occurred.
586.    */
587. > static int addrinfo_wrap(int family, int socktype,
588.                            const void *where, size_t wherelen,
589.                            unsigned short port,

crypto/bio/b_addr.c:592:5: Condition is true
590.                            BIO_ADDRINFO **bai)
591.   {
592.       OPENSSL_assert(bai != NULL);
           ^
593.   
594.       *bai = OPENSSL_zalloc(sizeof(**bai));

crypto/bio/b_addr.c:594:5: 
592.       OPENSSL_assert(bai != NULL);
593.   
594. >     *bai = OPENSSL_zalloc(sizeof(**bai));
595.       if (*bai == NULL)
596.           return 0;

crypto/mem.c:185:1: start of procedure CRYPTO_zalloc()
  183.   }
  184.   
  185. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  186.   {
  187.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:187:5: 
  185.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  186.   {
  187. >     void *ret = CRYPTO_malloc(num, file, line);
  188.   
  189.       FAILTEST();

crypto/mem.c:157:1: start of procedure CRYPTO_malloc()
    155.   #endif
    156.   
    157. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    158.   {
    159.       void *ret = NULL;

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

crypto/mem.c:161:9: Taking false branch
    159.       void *ret = NULL;
    160.   
    161.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    162.           return malloc_impl(num, file, line);
    163.   

crypto/mem.c:164:9: Taking false branch
    162.           return malloc_impl(num, file, line);
    163.   
    164.       if (num <= 0)
                   ^
    165.           return NULL;
    166.   

crypto/mem.c:168:5: 
    166.   
    167.       FAILTEST();
    168. >     allow_customize = 0;
    169.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    170.       if (call_malloc_debug) {

crypto/mem.c:178:5: 
    176.       }
    177.   #else
    178. >     osslargused(file); osslargused(line);
    179.       ret = malloc(num);
    180.   #endif

crypto/mem.c:178:24: 
    176.       }
    177.   #else
    178. >     osslargused(file); osslargused(line);
    179.       ret = malloc(num);
    180.   #endif

crypto/mem.c:179:5: 
    177.   #else
    178.       osslargused(file); osslargused(line);
    179. >     ret = malloc(num);
    180.   #endif
    181.   

crypto/mem.c:182:5: 
    180.   #endif
    181.   
    182. >     return ret;
    183.   }
    184.   

crypto/mem.c:183:1: return from a call to CRYPTO_malloc
    181.   
    182.       return ret;
    183. > }
    184.   
    185.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:190:9: Taking true branch
  188.   
  189.       FAILTEST();
  190.       if (ret != NULL)
                 ^
  191.           memset(ret, 0, num);
  192.       return ret;

crypto/mem.c:191:9: 
  189.       FAILTEST();
  190.       if (ret != NULL)
  191. >         memset(ret, 0, num);
  192.       return ret;
  193.   }

crypto/mem.c:192:5: 
  190.       if (ret != NULL)
  191.           memset(ret, 0, num);
  192. >     return ret;
  193.   }
  194.   

crypto/mem.c:193:1: return from a call to CRYPTO_zalloc
  191.           memset(ret, 0, num);
  192.       return ret;
  193. > }
  194.   
  195.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/bio/b_addr.c:595:9: Taking false branch
593.   
594.       *bai = OPENSSL_zalloc(sizeof(**bai));
595.       if (*bai == NULL)
               ^
596.           return 0;
597.   

crypto/bio/b_addr.c:598:5: 
596.           return 0;
597.   
598. >     (*bai)->bai_family = family;
599.       (*bai)->bai_socktype = socktype;
600.       if (socktype == SOCK_STREAM)

crypto/bio/b_addr.c:599:5: 
597.   
598.       (*bai)->bai_family = family;
599. >     (*bai)->bai_socktype = socktype;
600.       if (socktype == SOCK_STREAM)
601.           (*bai)->bai_protocol = IPPROTO_TCP;

crypto/bio/b_addr.c:600:9: Taking false branch
598.       (*bai)->bai_family = family;
599.       (*bai)->bai_socktype = socktype;
600.       if (socktype == SOCK_STREAM)
               ^
601.           (*bai)->bai_protocol = IPPROTO_TCP;
602.       if (socktype == SOCK_DGRAM)

crypto/bio/b_addr.c:602:9: Taking false branch
600.       if (socktype == SOCK_STREAM)
601.           (*bai)->bai_protocol = IPPROTO_TCP;
602.       if (socktype == SOCK_DGRAM)
               ^
603.           (*bai)->bai_protocol = IPPROTO_UDP;
604.   #ifdef AF_UNIX

crypto/bio/b_addr.c:605:9: Taking false branch
603.           (*bai)->bai_protocol = IPPROTO_UDP;
604.   #ifdef AF_UNIX
605.       if (family == AF_UNIX)
               ^
606.           (*bai)->bai_protocol = 0;
607.   #endif

crypto/bio/b_addr.c:614:9: Skipping BIO_ADDR_new(): empty list of specs
612.              creating a memory leak here, we are not.  It will be
613.              all right. */
614.           BIO_ADDR *addr = BIO_ADDR_new();
               ^
615.           if (addr != NULL) {
616.               BIO_ADDR_rawmake(addr, family, where, wherelen, port);

crypto/bio/b_addr.c:615:13: Taking false branch
613.              all right. */
614.           BIO_ADDR *addr = BIO_ADDR_new();
615.           if (addr != NULL) {
                   ^
616.               BIO_ADDR_rawmake(addr, family, where, wherelen, port);
617.               (*bai)->bai_addr = BIO_ADDR_sockaddr_noconst(addr);

crypto/bio/b_addr.c:620:5: 
618.           }
619.       }
620. >     (*bai)->bai_next = NULL;
621.       if ((*bai)->bai_addr == NULL) {
622.           BIO_ADDRINFO_free(*bai);

crypto/bio/b_addr.c:621:9: Taking true branch
619.       }
620.       (*bai)->bai_next = NULL;
621.       if ((*bai)->bai_addr == NULL) {
               ^
622.           BIO_ADDRINFO_free(*bai);
623.           *bai = NULL;

crypto/bio/b_addr.c:622:9: Skipping BIO_ADDRINFO_free(): empty list of specs
620.       (*bai)->bai_next = NULL;
621.       if ((*bai)->bai_addr == NULL) {
622.           BIO_ADDRINFO_free(*bai);
               ^
623.           *bai = NULL;
624.           return 0;

crypto/bio/b_addr.c:623:9: 
621.       if ((*bai)->bai_addr == NULL) {
622.           BIO_ADDRINFO_free(*bai);
623. >         *bai = NULL;
624.           return 0;
625.       }
