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


crypto/bio/bss_conn.c:119:1: start of procedure conn_state()
117.   };
118.   
119. > static int conn_state(BIO *b, BIO_CONNECT *c)
120.   {
121.       int ret = -1, i;

crypto/bio/bss_conn.c:121:5: 
119.   static int conn_state(BIO *b, BIO_CONNECT *c)
120.   {
121. >     int ret = -1, i;
122.       int (*cb) (const BIO *, int, int) = NULL;
123.   

crypto/bio/bss_conn.c:122:5: 
120.   {
121.       int ret = -1, i;
122. >     int (*cb) (const BIO *, int, int) = NULL;
123.   
124.       if (c->info_callback != NULL)

crypto/bio/bss_conn.c:124:9: Taking true branch
122.       int (*cb) (const BIO *, int, int) = NULL;
123.   
124.       if (c->info_callback != NULL)
               ^
125.           cb = c->info_callback;
126.   

crypto/bio/bss_conn.c:125:9: 
123.   
124.       if (c->info_callback != NULL)
125. >         cb = c->info_callback;
126.   
127.       for (;;) {

crypto/bio/bss_conn.c:256:5: Loop condition is true. Entering loop body
254.                   goto end;
255.           }
256.       }
           ^
257.   
258.       /* Loop does not exit */

crypto/bio/bss_conn.c:128:9: 
126.   
127.       for (;;) {
128. >         switch (c->state) {
129.           case BIO_CONN_S_BEFORE:
130.               if (c->param_hostname == NULL && c->param_service == NULL) {

crypto/bio/bss_conn.c:129:9: Switch condition is false. Skipping switch case
127.       for (;;) {
128.           switch (c->state) {
129.           case BIO_CONN_S_BEFORE:
               ^
130.               if (c->param_hostname == NULL && c->param_service == NULL) {
131.                   BIOerr(BIO_F_CONN_STATE, BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED);

crypto/bio/bss_conn.c:140:9: Switch condition is false. Skipping switch case
138.               break;
139.   
140.           case BIO_CONN_S_GET_ADDR:
               ^
141.               {
142.                   int family = AF_UNSPEC;

crypto/bio/bss_conn.c:180:9: Switch condition is true. Entering switch case
178.               break;
179.   
180.           case BIO_CONN_S_CREATE_SOCKET:
               ^
181.               ret = BIO_socket(BIO_ADDRINFO_family(c->addr_iter),
182.                                BIO_ADDRINFO_socktype(c->addr_iter),

crypto/bio/bss_conn.c:181:13: 
179.   
180.           case BIO_CONN_S_CREATE_SOCKET:
181. >             ret = BIO_socket(BIO_ADDRINFO_family(c->addr_iter),
182.                                BIO_ADDRINFO_socktype(c->addr_iter),
183.                                BIO_ADDRINFO_protocol(c->addr_iter), 0);

crypto/bio/b_addr.c:344:1: start of procedure BIO_ADDRINFO_family()
  342.   }
  343.   
  344. > int BIO_ADDRINFO_family(const BIO_ADDRINFO *bai)
  345.   {
  346.       if (bai != NULL)

crypto/bio/b_addr.c:346:9: Taking true branch
  344.   int BIO_ADDRINFO_family(const BIO_ADDRINFO *bai)
  345.   {
  346.       if (bai != NULL)
                 ^
  347.           return bai->bai_family;
  348.       return 0;

crypto/bio/b_addr.c:347:9: 
  345.   {
  346.       if (bai != NULL)
  347. >         return bai->bai_family;
  348.       return 0;
  349.   }

crypto/bio/b_addr.c:349:1: return from a call to BIO_ADDRINFO_family
  347.           return bai->bai_family;
  348.       return 0;
  349. > }
  350.   
  351.   int BIO_ADDRINFO_socktype(const BIO_ADDRINFO *bai)

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

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

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

crypto/bio/b_addr.c:356:1: return from a call to BIO_ADDRINFO_socktype
  354.           return bai->bai_socktype;
  355.       return 0;
  356. > }
  357.   
  358.   int BIO_ADDRINFO_protocol(const BIO_ADDRINFO *bai)

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

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

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

crypto/bio/b_addr.c:363:1: return from a call to BIO_ADDRINFO_protocol
  361.           return bai->bai_protocol;
  362.       return 0;
  363. > }
  364.   
  365.   /*

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

crypto/bio/b_sock2.c:87:5: 
  85.   int BIO_socket(int domain, int socktype, int protocol, int options)
  86.   {
  87. >     int sock = -1;
  88.   
  89.       if (BIO_sock_init() != 1)

crypto/bio/b_sock2.c:89:9: 
  87.       int sock = -1;
  88.   
  89. >     if (BIO_sock_init() != 1)
  90.           return INVALID_SOCKET;
  91.   

crypto/bio/b_sock.c:186:1: start of procedure BIO_sock_init()
    184.   # endif
    185.   
    186. > int BIO_sock_init(void)
    187.   {
    188.   # ifdef OPENSSL_SYS_WINDOWS

crypto/bio/b_sock.c:234:5: 
    232.   # endif
    233.   
    234. >     return (1);
    235.   }
    236.   

crypto/bio/b_sock.c:235:1: return from a call to BIO_sock_init
    233.   
    234.       return (1);
    235. > }
    236.   
    237.   void BIO_sock_cleanup(void)

crypto/bio/b_sock2.c:89:9: Taking false branch
  87.       int sock = -1;
  88.   
  89.       if (BIO_sock_init() != 1)
                ^
  90.           return INVALID_SOCKET;
  91.   

crypto/bio/b_sock2.c:92:5: 
  90.           return INVALID_SOCKET;
  91.   
  92. >     sock = socket(domain, socktype, protocol);
  93.       if (sock == -1) {
  94.           SYSerr(SYS_F_SOCKET, get_last_socket_error());

crypto/bio/b_sock2.c:93:9: Taking false branch
  91.   
  92.       sock = socket(domain, socktype, protocol);
  93.       if (sock == -1) {
                ^
  94.           SYSerr(SYS_F_SOCKET, get_last_socket_error());
  95.           BIOerr(BIO_F_BIO_SOCKET, BIO_R_UNABLE_TO_CREATE_SOCKET);

crypto/bio/b_sock2.c:99:5: 
  97.       }
  98.   
  99. >     return sock;
  100.   }
  101.   

crypto/bio/b_sock2.c:100:1: return from a call to BIO_socket
  98.   
  99.       return sock;
  100. > }
  101.   
  102.   /*-

crypto/bio/bss_conn.c:184:17: Taking false branch
182.                                BIO_ADDRINFO_socktype(c->addr_iter),
183.                                BIO_ADDRINFO_protocol(c->addr_iter), 0);
184.               if (ret == (int)INVALID_SOCKET) {
                       ^
185.                   SYSerr(SYS_F_SOCKET, get_last_socket_error());
186.                   ERR_add_error_data(4,

crypto/bio/bss_conn.c:192:13: 
190.                   goto exit_loop;
191.               }
192. >             b->num = ret;
193.               c->state = BIO_CONN_S_CONNECT;
194.               break;

crypto/bio/bss_conn.c:193:13: 
191.               }
192.               b->num = ret;
193. >             c->state = BIO_CONN_S_CONNECT;
194.               break;
195.   

crypto/bio/bss_conn.c:252:13: Taking true branch
250.           }
251.   
252.           if (cb != NULL) {
                   ^
253.               if ((ret = cb((BIO *)b, c->state, ret)) == 0)
254.                   goto end;

crypto/bio/bss_conn.c:253:17: Skipping __function_pointer__(): unresolved function pointer
251.   
252.           if (cb != NULL) {
253.               if ((ret = cb((BIO *)b, c->state, ret)) == 0)
                       ^
254.                   goto end;
255.           }
