summaryrefslogtreecommitdiffstats
path: root/engines
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2010-02-16 14:30:29 +0000
committerDr. Stephen Henson <steve@openssl.org>2010-02-16 14:30:29 +0000
commit439aab3afca0cb7478db39396aa82c574fe73bcd (patch)
treedb05f4932b9113ef699d0e1f9b12ffee97c33f88 /engines
parent8d934c2585b2938344af328799286fd2526b579d (diff)
Submitted by: Dmitry Ivanov <vonami@gmail.com>
Don't leave dangling pointers in GOST engine if calls fail.
Diffstat (limited to 'engines')
-rw-r--r--engines/ccgost/gost2001.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/ccgost/gost2001.c b/engines/ccgost/gost2001.c
index e3354549e1..dacd82d2b9 100644
--- a/engines/ccgost/gost2001.c
+++ b/engines/ccgost/gost2001.c
@@ -136,12 +136,14 @@ DSA_SIG *gost2001_do_sign(const unsigned char *dgst,int dlen, EC_KEY *eckey)
{
GOSTerr(GOST_F_GOST2001_DO_SIGN,GOST_R_RANDOM_NUMBER_GENERATOR_FAILED);
DSA_SIG_free(newsig);
+ newsig = NULL;
goto err;
}
if (!EC_POINT_mul(group,C,k,NULL,NULL,ctx))
{
GOSTerr(GOST_F_GOST2001_DO_SIGN,ERR_R_EC_LIB);
DSA_SIG_free(newsig);
+ newsig = NULL;
goto err;
}
if (!X) X=BN_CTX_get(ctx);
@@ -149,6 +151,7 @@ DSA_SIG *gost2001_do_sign(const unsigned char *dgst,int dlen, EC_KEY *eckey)
{
GOSTerr(GOST_F_GOST2001_DO_SIGN,ERR_R_EC_LIB);
DSA_SIG_free(newsig);
+ newsig = NULL;
goto err;
}
if (!r) r=BN_CTX_get(ctx);