Commit 05d909c5 authored by Geoff Thorpe's avatar Geoff Thorpe
Browse files

* Migrate the engine code's Malloc + Free calls to the newer

  OPENSSL_malloc and OPENSSL_free.

* 3 "normal" files (crypto/rsa/rsa_lib.c, crypto/dsa/dsa_lib.c
  and crypto/dh/dh_lib.c) had their Malloc's and Free's missed
  when Richard merged the changes across to this branch -
  probably because those files have been changed in this branch
  and gave some grief to the merge - so I've changed them
  manually here.
parent d44c7dcf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ DH *DH_new_method(ENGINE *engine)
		{
		if((ret->engine=ENGINE_get_default_DH()) == NULL)
			{
			Free(ret);
			OPENSSL_free(ret);
			return NULL;
			}
		}
+1 −1
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ DSA *DSA_new_method(ENGINE *engine)
		{
		if((ret->engine=ENGINE_get_default_DSA()) == NULL)
			{
			Free(ret);
			OPENSSL_free(ret);
			return NULL;
			}
		}
+3 −3
Original line number Diff line number Diff line
@@ -349,7 +349,7 @@ ENGINE *ENGINE_new(ENGINE *e)

	if(e == NULL)
		{
		ret = (ENGINE *)Malloc(sizeof(ENGINE));
		ret = (ENGINE *)(OPENSSL_malloc(sizeof(ENGINE));
		if(ret == NULL)
			{
			ENGINEerr(ENGINE_F_ENGINE_NEW,
@@ -370,7 +370,7 @@ ENGINE *ENGINE_new(void)
	{
	ENGINE *ret;

	ret = (ENGINE *)Malloc(sizeof(ENGINE));
	ret = (ENGINE *)OPENSSL_malloc(sizeof(ENGINE));
	if(ret == NULL)
		{
		ENGINEerr(ENGINE_F_ENGINE_NEW, ERR_R_MALLOC_FAILURE);
@@ -406,7 +406,7 @@ int ENGINE_free(ENGINE *e)
		}
#endif
	if(e->flags & ENGINE_FLAGS_MALLOCED)
		Free(e);
		OPENSSL_free(e);
	return 1;
	}

+1 −1
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ RSA *RSA_new_method(ENGINE *engine)
		{
		if((ret->engine=ENGINE_get_default_RSA()) == NULL)
			{
			Free(ret);
			OPENSSL_free(ret);
			return NULL;
			}
		}