ssl/bio_ssl.c:358: error: USE_AFTER_FREE
  accessing memory that was invalidated by call to `free()` on line 355 indirectly during the call to `ssl_free()`.
Showing all 8 steps of the trace


ssl/bio_ssl.c:300:1: invalidation part of the trace starts here
298.   	}
299.   
300. > static long ssl_ctrl(BIO *b, int cmd, long num, char *ptr)
301.   	{
302.   	SSL **sslp,*ssl;

ssl/bio_ssl.c:300:1: parameter `b` of ssl_ctrl
  298.   	}
  299.   
  300. > static long ssl_ctrl(BIO *b, int cmd, long num, char *ptr)
  301.   	{
  302.   	SSL **sslp,*ssl;

ssl/bio_ssl.c:355:4: when calling `ssl_free` here
  353.   	case BIO_C_SET_SSL:
  354.   		if (ssl != NULL)
  355.   			ssl_free(b);
            ^
  356.   		b->shutdown=(int)num;
  357.   		ssl=(SSL *)ptr;

ssl/bio_ssl.c:129:1: parameter `a` of ssl_free
    127.   	}
    128.   
    129. > static int ssl_free(BIO *a)
    130.   	{
    131.   	BIO_SSL *bs;

ssl/bio_ssl.c:144:3: was invalidated by call to `free()`
    142.   		}
    143.   	if (a->ptr != NULL)
    144.   		Free(a->ptr);
             ^
    145.   	return(1);
    146.   	}

ssl/bio_ssl.c:300:1: use-after-lifetime part of the trace starts here
298.   	}
299.   
300. > static long ssl_ctrl(BIO *b, int cmd, long num, char *ptr)
301.   	{
302.   	SSL **sslp,*ssl;

ssl/bio_ssl.c:300:1: parameter `b` of ssl_ctrl
  298.   	}
  299.   
  300. > static long ssl_ctrl(BIO *b, int cmd, long num, char *ptr)
  301.   	{
  302.   	SSL **sslp,*ssl;

ssl/bio_ssl.c:358:3: invalid access occurs here
  356.   		b->shutdown=(int)num;
  357.   		ssl=(SSL *)ptr;
  358.   		((BIO_SSL *)b->ptr)->ssl=ssl;
           ^
  359.   		bio=SSL_get_rbio(ssl);
  360.   		if (bio != NULL)
