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


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

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

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

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 true 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:164:9: 
  162.   
  163.       if (ret != NULL)
  164. >         memset(ret, 0, num);
  165.       return ret;
  166.   }

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:592:9: Taking false branch
590.   
591.       *bai = OPENSSL_zalloc(sizeof(**bai));
592.       if (*bai == NULL)
               ^
593.           return 0;
594.   

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

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

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

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

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

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

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

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

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

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

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