crypto/bio/bss_conn.c:206: error: RESOURCE_LEAK
  resource acquired by call to `BIO_socket()` at line 137, column 19 is not released after line 206, column 18.
Showing all 40 steps of the trace


crypto/bio/bss_conn.c:75:1: start of procedure conn_state()
73.   };
74.   
75. > static int conn_state(BIO *b, BIO_CONNECT *c)
76.   {
77.       int ret = -1, i;

crypto/bio/bss_conn.c:77:5: 
75.   static int conn_state(BIO *b, BIO_CONNECT *c)
76.   {
77. >     int ret = -1, i;
78.       BIO_info_cb *cb = NULL;
79.   

crypto/bio/bss_conn.c:78:5: 
76.   {
77.       int ret = -1, i;
78. >     BIO_info_cb *cb = NULL;
79.   
80.       if (c->info_callback != NULL)

crypto/bio/bss_conn.c:80:9: Taking true branch
78.       BIO_info_cb *cb = NULL;
79.   
80.       if (c->info_callback != NULL)
              ^
81.           cb = c->info_callback;
82.   

crypto/bio/bss_conn.c:81:9: 
79.   
80.       if (c->info_callback != NULL)
81. >         cb = c->info_callback;
82.   
83.       for (;;) {

crypto/bio/bss_conn.c:209:5: Loop condition is true. Entering loop body
207.                   goto end;
208.           }
209.       }
           ^
210.   
211.       /* Loop does not exit */

crypto/bio/bss_conn.c:84:9: 
82.   
83.       for (;;) {
84. >         switch (c->state) {
85.           case BIO_CONN_S_BEFORE:
86.               if (c->param_hostname == NULL && c->param_service == NULL) {

crypto/bio/bss_conn.c:85:9: Switch condition is false. Skipping switch case
83.       for (;;) {
84.           switch (c->state) {
85.           case BIO_CONN_S_BEFORE:
              ^
86.               if (c->param_hostname == NULL && c->param_service == NULL) {
87.                   BIOerr(BIO_F_CONN_STATE, BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED);

crypto/bio/bss_conn.c:96:9: Switch condition is false. Skipping switch case
94.               break;
95.   
96.           case BIO_CONN_S_GET_ADDR:
              ^
97.               {
98.                   int family = AF_UNSPEC;

crypto/bio/bss_conn.c:136:9: Switch condition is true. Entering switch case
134.               break;
135.   
136.           case BIO_CONN_S_CREATE_SOCKET:
               ^
137.               ret = BIO_socket(BIO_ADDRINFO_family(c->addr_iter),
138.                                BIO_ADDRINFO_socktype(c->addr_iter),

crypto/bio/bss_conn.c:137:13: 
135.   
136.           case BIO_CONN_S_CREATE_SOCKET:
137. >             ret = BIO_socket(BIO_ADDRINFO_family(c->addr_iter),
138.                                BIO_ADDRINFO_socktype(c->addr_iter),
139.                                BIO_ADDRINFO_protocol(c->addr_iter), 0);

crypto/bio/b_addr.c:349:1: start of procedure BIO_ADDRINFO_family()
  347.   }
  348.   
  349. > int BIO_ADDRINFO_family(const BIO_ADDRINFO *bai)
  350.   {
  351.       if (bai != NULL)

crypto/bio/b_addr.c:351:9: Taking true branch
  349.   int BIO_ADDRINFO_family(const BIO_ADDRINFO *bai)
  350.   {
  351.       if (bai != NULL)
                 ^
  352.           return bai->bai_family;
  353.       return 0;

crypto/bio/b_addr.c:352:9: 
  350.   {
  351.       if (bai != NULL)
  352. >         return bai->bai_family;
  353.       return 0;
  354.   }

crypto/bio/b_addr.c:354:1: return from a call to BIO_ADDRINFO_family
  352.           return bai->bai_family;
  353.       return 0;
  354. > }
  355.   
  356.   int BIO_ADDRINFO_socktype(const BIO_ADDRINFO *bai)

crypto/bio/b_addr.c:356:1: start of procedure BIO_ADDRINFO_socktype()
  354.   }
  355.   
  356. > int BIO_ADDRINFO_socktype(const BIO_ADDRINFO *bai)
  357.   {
  358.       if (bai != NULL)

crypto/bio/b_addr.c:358:9: Taking true branch
  356.   int BIO_ADDRINFO_socktype(const BIO_ADDRINFO *bai)
  357.   {
  358.       if (bai != NULL)
                 ^
  359.           return bai->bai_socktype;
  360.       return 0;

crypto/bio/b_addr.c:359:9: 
  357.   {
  358.       if (bai != NULL)
  359. >         return bai->bai_socktype;
  360.       return 0;
  361.   }

crypto/bio/b_addr.c:361:1: return from a call to BIO_ADDRINFO_socktype
  359.           return bai->bai_socktype;
  360.       return 0;
  361. > }
  362.   
  363.   int BIO_ADDRINFO_protocol(const BIO_ADDRINFO *bai)

crypto/bio/b_addr.c:363:1: start of procedure BIO_ADDRINFO_protocol()
  361.   }
  362.   
  363. > int BIO_ADDRINFO_protocol(const BIO_ADDRINFO *bai)
  364.   {
  365.       if (bai != NULL) {

crypto/bio/b_addr.c:365:9: Taking true branch
  363.   int BIO_ADDRINFO_protocol(const BIO_ADDRINFO *bai)
  364.   {
  365.       if (bai != NULL) {
                 ^
  366.           if (bai->bai_protocol != 0)
  367.               return bai->bai_protocol;

crypto/bio/b_addr.c:366:13: Taking true branch
  364.   {
  365.       if (bai != NULL) {
  366.           if (bai->bai_protocol != 0)
                     ^
  367.               return bai->bai_protocol;
  368.   

crypto/bio/b_addr.c:367:13: 
  365.       if (bai != NULL) {
  366.           if (bai->bai_protocol != 0)
  367. >             return bai->bai_protocol;
  368.   
  369.   #ifdef AF_UNIX

crypto/bio/b_addr.c:384:1: return from a call to BIO_ADDRINFO_protocol
  382.       }
  383.       return 0;
  384. > }
  385.   
  386.   /*

crypto/bio/b_sock2.c:40:1: start of procedure BIO_socket()
  38.    * failure errno is set, and a status is added to the OpenSSL error stack.
  39.    */
  40. > int BIO_socket(int domain, int socktype, int protocol, int options)
  41.   {
  42.       int sock = -1;

crypto/bio/b_sock2.c:42:5: 
  40.   int BIO_socket(int domain, int socktype, int protocol, int options)
  41.   {
  42. >     int sock = -1;
  43.   
  44.       if (BIO_sock_init() != 1)

crypto/bio/b_sock2.c:44:9: 
  42.       int sock = -1;
  43.   
  44. >     if (BIO_sock_init() != 1)
  45.           return INVALID_SOCKET;
  46.   

crypto/bio/b_sock.c:117:1: start of procedure BIO_sock_init()
    115.   # endif
    116.   
    117. > int BIO_sock_init(void)
    118.   {
    119.   # ifdef OPENSSL_SYS_WINDOWS

crypto/bio/b_sock.c:146:5: 
    144.   # endif
    145.   
    146. >     return 1;
    147.   }
    148.   

crypto/bio/b_sock.c:147:1: return from a call to BIO_sock_init
    145.   
    146.       return 1;
    147. > }
    148.   
    149.   void bio_sock_cleanup_int(void)

crypto/bio/b_sock2.c:44:9: Taking false branch
  42.       int sock = -1;
  43.   
  44.       if (BIO_sock_init() != 1)
                ^
  45.           return INVALID_SOCKET;
  46.   

crypto/bio/b_sock2.c:47:5: 
  45.           return INVALID_SOCKET;
  46.   
  47. >     sock = socket(domain, socktype, protocol);
  48.       if (sock == -1) {
  49.           ERR_raise_data(ERR_LIB_SYS, get_last_socket_error(),

crypto/bio/b_sock2.c:48:9: Taking false branch
  46.   
  47.       sock = socket(domain, socktype, protocol);
  48.       if (sock == -1) {
                ^
  49.           ERR_raise_data(ERR_LIB_SYS, get_last_socket_error(),
  50.                          "calling socket()");

crypto/bio/b_sock2.c:55:5: 
  53.       }
  54.   
  55. >     return sock;
  56.   }
  57.   

crypto/bio/b_sock2.c:56:1: return from a call to BIO_socket
  54.   
  55.       return sock;
  56. > }
  57.   
  58.   /*-

crypto/bio/bss_conn.c:140:17: Taking false branch
138.                                BIO_ADDRINFO_socktype(c->addr_iter),
139.                                BIO_ADDRINFO_protocol(c->addr_iter), 0);
140.               if (ret == (int)INVALID_SOCKET) {
                       ^
141.                   ERR_raise_data(ERR_LIB_SYS, get_last_socket_error(),
142.                                  "calling socket(%s, %s)",

crypto/bio/bss_conn.c:147:13: 
145.                   goto exit_loop;
146.               }
147. >             b->num = ret;
148.               c->state = BIO_CONN_S_CONNECT;
149.               break;

crypto/bio/bss_conn.c:148:13: 
146.               }
147.               b->num = ret;
148. >             c->state = BIO_CONN_S_CONNECT;
149.               break;
150.   

crypto/bio/bss_conn.c:205:13: Taking true branch
203.           }
204.   
205.           if (cb != NULL) {
                   ^
206.               if ((ret = cb((BIO *)b, c->state, ret)) == 0)
207.                   goto end;

crypto/bio/bss_conn.c:206:17: Skipping __function_pointer__(): unresolved function pointer
204.   
205.           if (cb != NULL) {
206.               if ((ret = cb((BIO *)b, c->state, ret)) == 0)
                       ^
207.                   goto end;
208.           }
