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


crypto/bio/b_addr.c:553:1: start of procedure addrinfo_wrap()
551.    * only happens if a memory allocation error occured.
552.    */
553. > static int addrinfo_wrap(int family, int socktype,
554.                            const void *where, size_t wherelen,
555.                            unsigned short port,

crypto/bio/b_addr.c:558:5: Condition is true
556.                            BIO_ADDRINFO **bai)
557.   {
558.       OPENSSL_assert(bai != NULL);
           ^
559.   
560.       *bai = (BIO_ADDRINFO *)OPENSSL_zalloc(sizeof(**bai));

crypto/bio/b_addr.c:560:5: 
558.       OPENSSL_assert(bai != NULL);
559.   
560. >     *bai = (BIO_ADDRINFO *)OPENSSL_zalloc(sizeof(**bai));
561.   
562.       if (*bai == NULL)

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

crypto/mem.c:158:5: 
  156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  157.   {
  158. >     void *ret = CRYPTO_malloc(num, file, line);
  159.   
  160.       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 (num <= 0)

crypto/mem.c:123:9: Taking false branch
    121.       void *ret = NULL;
    122.   
    123.       if (num <= 0)
                   ^
    124.           return NULL;
    125.   

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

crypto/mem.c:136:5: 
    134.       }
    135.   #else
    136. >     (void)file;
    137.       (void)line;
    138.       ret = malloc(num);

crypto/mem.c:137:5: 
    135.   #else
    136.       (void)file;
    137. >     (void)line;
    138.       ret = malloc(num);
    139.   #endif

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

crypto/mem.c:153:5: 
    151.   #endif
    152.   
    153. >     return ret;
    154.   }
    155.   

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

crypto/mem.c:160:9: Taking true branch
  158.       void *ret = CRYPTO_malloc(num, file, line);
  159.   
  160.       if (ret != NULL)
                 ^
  161.           memset(ret, 0, num);
  162.       return ret;

crypto/mem.c:161:9: 
  159.   
  160.       if (ret != NULL)
  161. >         memset(ret, 0, num);
  162.       return ret;
  163.   }

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

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

crypto/bio/b_addr.c:562:9: Taking false branch
560.       *bai = (BIO_ADDRINFO *)OPENSSL_zalloc(sizeof(**bai));
561.   
562.       if (*bai == NULL)
               ^
563.           return 0;
564.       (*bai)->bai_family = family;

crypto/bio/b_addr.c:564:5: 
562.       if (*bai == NULL)
563.           return 0;
564. >     (*bai)->bai_family = family;
565.       (*bai)->bai_socktype = socktype;
566.       if (socktype == SOCK_STREAM)

crypto/bio/b_addr.c:565:5: 
563.           return 0;
564.       (*bai)->bai_family = family;
565. >     (*bai)->bai_socktype = socktype;
566.       if (socktype == SOCK_STREAM)
567.           (*bai)->bai_protocol = IPPROTO_TCP;

crypto/bio/b_addr.c:566:9: Taking false branch
564.       (*bai)->bai_family = family;
565.       (*bai)->bai_socktype = socktype;
566.       if (socktype == SOCK_STREAM)
               ^
567.           (*bai)->bai_protocol = IPPROTO_TCP;
568.       if (socktype == SOCK_DGRAM)

crypto/bio/b_addr.c:568:9: Taking false branch
566.       if (socktype == SOCK_STREAM)
567.           (*bai)->bai_protocol = IPPROTO_TCP;
568.       if (socktype == SOCK_DGRAM)
               ^
569.           (*bai)->bai_protocol = IPPROTO_UDP;
570.   #ifdef AF_UNIX

crypto/bio/b_addr.c:571:9: Taking false branch
569.           (*bai)->bai_protocol = IPPROTO_UDP;
570.   #ifdef AF_UNIX
571.       if (family == AF_UNIX)
               ^
572.           (*bai)->bai_protocol = 0;
573.   #endif

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

crypto/bio/b_addr.c:581:13: Taking false branch
579.              all right. */
580.           BIO_ADDR *addr = BIO_ADDR_new();
581.           if (addr != NULL) {
                   ^
582.               BIO_ADDR_rawmake(addr, family, where, wherelen, port);
583.               (*bai)->bai_addr = BIO_ADDR_sockaddr_noconst(addr);

crypto/bio/b_addr.c:586:5: 
584.           }
585.       }
586. >     (*bai)->bai_next = NULL;
587.       if ((*bai)->bai_addr == NULL) {
588.           BIO_ADDRINFO_free(*bai);

crypto/bio/b_addr.c:587:9: Taking true branch
585.       }
586.       (*bai)->bai_next = NULL;
587.       if ((*bai)->bai_addr == NULL) {
               ^
588.           BIO_ADDRINFO_free(*bai);
589.           *bai = NULL;

crypto/bio/b_addr.c:588:9: Skipping BIO_ADDRINFO_free(): empty list of specs
586.       (*bai)->bai_next = NULL;
587.       if ((*bai)->bai_addr == NULL) {
588.           BIO_ADDRINFO_free(*bai);
               ^
589.           *bai = NULL;
590.           return 0;

crypto/bio/b_addr.c:589:9: 
587.       if ((*bai)->bai_addr == NULL) {
588.           BIO_ADDRINFO_free(*bai);
589. >         *bai = NULL;
590.           return 0;
591.       }
