Only cleanse sbuf if it is not NULL.

PR#2339
This commit is contained in:
Dr. Stephen Henson 2014-07-05 22:32:39 +01:00
parent 114216bca0
commit 6ea511211c

View file

@ -288,8 +288,11 @@ int FIPS_rsa_sign_digest(RSA *rsa, const unsigned char *md, int md_len,
*siglen=j;
}
psserr:
OPENSSL_cleanse(sbuf, i);
OPENSSL_free(sbuf);
if (sbuf)
{
OPENSSL_cleanse(sbuf, i);
OPENSSL_free(sbuf);
}
return ret;
}