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


ssl/ssltest.c:714:1: start of procedure get_dh512()
712.   	};
713.   
714. > static DH *get_dh512(void)
715.   	{
716.   	DH *dh=NULL;

ssl/ssltest.c:716:2: 
714.   static DH *get_dh512(void)
715.   	{
716. > 	DH *dh=NULL;
717.   
718.   	if ((dh=DH_new()) == NULL) return(NULL);

ssl/ssltest.c:718:6: 
716.   	DH *dh=NULL;
717.   
718. > 	if ((dh=DH_new()) == NULL) return(NULL);
719.   	dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
720.   	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:718:6: Taking false branch
716.   	DH *dh=NULL;
717.   
718.   	if ((dh=DH_new()) == NULL) return(NULL);
            ^
719.   	dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
720.   	dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);

ssl/ssltest.c:719:2: Skipping BN_bin2bn(): empty list of specs
717.   
718.   	if ((dh=DH_new()) == NULL) return(NULL);
719.   	dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
        ^
720.   	dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);
721.   	if ((dh->p == NULL) || (dh->g == NULL))

ssl/ssltest.c:720:2: Skipping BN_bin2bn(): empty list of specs
718.   	if ((dh=DH_new()) == NULL) return(NULL);
719.   	dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
720.   	dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);
        ^
721.   	if ((dh->p == NULL) || (dh->g == NULL))
722.   		return(NULL);

ssl/ssltest.c:721:7: Taking false branch
719.   	dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
720.   	dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);
721.   	if ((dh->p == NULL) || (dh->g == NULL))
             ^
722.   		return(NULL);
723.   	return(dh);

ssl/ssltest.c:721:26: Taking true branch
719.   	dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
720.   	dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);
721.   	if ((dh->p == NULL) || (dh->g == NULL))
                                ^
722.   		return(NULL);
723.   	return(dh);

static DH *get_dh512(void)
	{
	DH *dh=NULL;
	if ((dh=DH_new()) == NULL) return(NULL);
	dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
	dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);
	if ((dh->p == NULL) || (dh->g == NULL))
		return(NULL);
	return(dh);
	}
['static DH *get_dh512(void)\n\t{\n\tDH *dh=NULL;\n\tif ((dh=DH_new()) == NULL) return(NULL);\n\tdh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);\n\tdh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);\n\tif ((dh->p == NULL) || (dh->g == NULL))\n\t\treturn(NULL);\n\treturn(dh);\n\t}', 'DH *DH_new(void)\n\t{\n\tDH *ret;\n\tret=(DH *)Malloc(sizeof(DH));\n\tif (ret == NULL)\n\t\t{\n\t\tDHerr(DH_F_DH_NEW,ERR_R_MALLOC_FAILURE);\n\t\treturn(NULL);\n\t\t}\n\tret->pad=0;\n\tret->version=0;\n\tret->p=NULL;\n\tret->g=NULL;\n\tret->length=0;\n\tret->pub_key=NULL;\n\tret->priv_key=NULL;\n\tret->flags=DH_FLAG_CACHE_MONT_P;\n\tret->method_mont_p=NULL;\n\treturn(ret);\n\t}']