ssl/ssltest.c:713: error: MEMORY_LEAK
  memory dynamically allocated to `dh` by call to `DH_new()` at line 710, column 10 is not reachable after line 713, column 7.
Showing all 21 steps of the trace


ssl/ssltest.c:706:1: start of procedure get_dh512()
704.   	};
705.   
706. > static DH *get_dh512(void)
707.   	{
708.   	DH *dh=NULL;

ssl/ssltest.c:708:2: 
706.   static DH *get_dh512(void)
707.   	{
708. > 	DH *dh=NULL;
709.   
710.   	if ((dh=DH_new()) == NULL) return(NULL);

ssl/ssltest.c:710:6: 
708.   	DH *dh=NULL;
709.   
710. > 	if ((dh=DH_new()) == NULL) return(NULL);
711.   	dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
712.   	dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);

crypto/dh/dh_lib.c:66:1: start of procedure DH_new()
  64.   const char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT;
  65.   
  66. > DH *DH_new(void)
  67.   	{
  68.   	DH *ret;

crypto/dh/dh_lib.c:70:2: 
  68.   	DH *ret;
  69.   
  70. > 	ret=(DH *)Malloc(sizeof(DH));
  71.   	if (ret == NULL)
  72.   		{

crypto/dh/dh_lib.c:71:6: Taking false branch
  69.   
  70.   	ret=(DH *)Malloc(sizeof(DH));
  71.   	if (ret == NULL)
             ^
  72.   		{
  73.   		DHerr(DH_F_DH_NEW,ERR_R_MALLOC_FAILURE);

crypto/dh/dh_lib.c:76:2: 
  74.   		return(NULL);
  75.   		}
  76. > 	ret->pad=0;
  77.   	ret->version=0;
  78.   	ret->p=NULL;

crypto/dh/dh_lib.c:77:2: 
  75.   		}
  76.   	ret->pad=0;
  77. > 	ret->version=0;
  78.   	ret->p=NULL;
  79.   	ret->g=NULL;

crypto/dh/dh_lib.c:78:2: 
  76.   	ret->pad=0;
  77.   	ret->version=0;
  78. > 	ret->p=NULL;
  79.   	ret->g=NULL;
  80.   	ret->length=0;

crypto/dh/dh_lib.c:79:2: 
  77.   	ret->version=0;
  78.   	ret->p=NULL;
  79. > 	ret->g=NULL;
  80.   	ret->length=0;
  81.   	ret->pub_key=NULL;

crypto/dh/dh_lib.c:80:2: 
  78.   	ret->p=NULL;
  79.   	ret->g=NULL;
  80. > 	ret->length=0;
  81.   	ret->pub_key=NULL;
  82.   	ret->priv_key=NULL;

crypto/dh/dh_lib.c:81:2: 
  79.   	ret->g=NULL;
  80.   	ret->length=0;
  81. > 	ret->pub_key=NULL;
  82.   	ret->priv_key=NULL;
  83.   	ret->flags=DH_FLAG_CACHE_MONT_P;

crypto/dh/dh_lib.c:82:2: 
  80.   	ret->length=0;
  81.   	ret->pub_key=NULL;
  82. > 	ret->priv_key=NULL;
  83.   	ret->flags=DH_FLAG_CACHE_MONT_P;
  84.   	ret->method_mont_p=NULL;

crypto/dh/dh_lib.c:83:2: 
  81.   	ret->pub_key=NULL;
  82.   	ret->priv_key=NULL;
  83. > 	ret->flags=DH_FLAG_CACHE_MONT_P;
  84.   	ret->method_mont_p=NULL;
  85.   	return(ret);

crypto/dh/dh_lib.c:84:2: 
  82.   	ret->priv_key=NULL;
  83.   	ret->flags=DH_FLAG_CACHE_MONT_P;
  84. > 	ret->method_mont_p=NULL;
  85.   	return(ret);
  86.   	}

crypto/dh/dh_lib.c:85:2: 
  83.   	ret->flags=DH_FLAG_CACHE_MONT_P;
  84.   	ret->method_mont_p=NULL;
  85. > 	return(ret);
  86.   	}
  87.   

crypto/dh/dh_lib.c:86:2: return from a call to DH_new
  84.   	ret->method_mont_p=NULL;
  85.   	return(ret);
  86.   	}
         ^
  87.   
  88.   void DH_free(DH *r)

ssl/ssltest.c:710:6: Taking false branch
708.   	DH *dh=NULL;
709.   
710.   	if ((dh=DH_new()) == NULL) return(NULL);
            ^
711.   	dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
712.   	dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);

ssl/ssltest.c:711:2: Skipping BN_bin2bn(): empty list of specs
709.   
710.   	if ((dh=DH_new()) == NULL) return(NULL);
711.   	dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
        ^
712.   	dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);
713.   	if ((dh->p == NULL) || (dh->g == NULL))

ssl/ssltest.c:712:2: Skipping BN_bin2bn(): empty list of specs
710.   	if ((dh=DH_new()) == NULL) return(NULL);
711.   	dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
712.   	dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);
        ^
713.   	if ((dh->p == NULL) || (dh->g == NULL))
714.   		return(NULL);

ssl/ssltest.c:713:7: Taking true branch
711.   	dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
712.   	dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);
713.   	if ((dh->p == NULL) || (dh->g == NULL))
             ^
714.   		return(NULL);
715.   	return(dh);
