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


ssl/bio_ssl.c:290:1: invalidation part of the trace starts here
288.   	}
289.   
290. > static long ssl_ctrl(BIO *b, int cmd, long num, char *ptr)
291.   	{
292.   	SSL **sslp,*ssl;

ssl/bio_ssl.c:290:1: parameter `b` of ssl_ctrl
  288.   	}
  289.   
  290. > static long ssl_ctrl(BIO *b, int cmd, long num, char *ptr)
  291.   	{
  292.   	SSL **sslp,*ssl;

ssl/bio_ssl.c:345:4: when calling `ssl_free` here
  343.   	case BIO_C_SET_SSL:
  344.   		if (ssl != NULL)
  345.   			ssl_free(b);
            ^
  346.   		b->shutdown=(int)num;
  347.   		ssl=(SSL *)ptr;

ssl/bio_ssl.c:119:1: parameter `a` of ssl_free
    117.   	}
    118.   
    119. > static int ssl_free(BIO *a)
    120.   	{
    121.   	BIO_SSL *bs;

ssl/bio_ssl.c:134:3: was invalidated by call to `free()`
    132.   		}
    133.   	if (a->ptr != NULL)
    134.   		Free(a->ptr);
             ^
    135.   	return(1);
    136.   	}

ssl/bio_ssl.c:290:1: use-after-lifetime part of the trace starts here
288.   	}
289.   
290. > static long ssl_ctrl(BIO *b, int cmd, long num, char *ptr)
291.   	{
292.   	SSL **sslp,*ssl;

ssl/bio_ssl.c:290:1: parameter `b` of ssl_ctrl
  288.   	}
  289.   
  290. > static long ssl_ctrl(BIO *b, int cmd, long num, char *ptr)
  291.   	{
  292.   	SSL **sslp,*ssl;

ssl/bio_ssl.c:348:3: invalid access occurs here
  346.   		b->shutdown=(int)num;
  347.   		ssl=(SSL *)ptr;
  348.   		((BIO_SSL *)b->ptr)->ssl=ssl;
           ^
  349.   		bio=SSL_get_rbio(ssl);
  350.   		if (bio != NULL)
