提交 a44a2084 编写于 作者: J J Mohan Rao Arisankala 提交者: Rich Salz

GH735: remove unnecessary allocation

Removing code, where memory was getting allocated for an unused variable
Signed-off-by: NRich Salz <rsalz@openssl.org>
Reviewed-by: NMatt Caswell <matt@openssl.org>
上级 6b2ebe43
...@@ -648,15 +648,10 @@ int tls1_export_keying_material(SSL *s, unsigned char *out, size_t olen, ...@@ -648,15 +648,10 @@ int tls1_export_keying_material(SSL *s, unsigned char *out, size_t olen,
const unsigned char *context, const unsigned char *context,
size_t contextlen, int use_context) size_t contextlen, int use_context)
{ {
unsigned char *buff;
unsigned char *val = NULL; unsigned char *val = NULL;
size_t vallen = 0, currentvalpos; size_t vallen = 0, currentvalpos;
int rv; int rv;
buff = OPENSSL_malloc(olen);
if (buff == NULL)
goto err2;
/* /*
* construct PRF arguments we construct the PRF argument ourself rather * construct PRF arguments we construct the PRF argument ourself rather
* than passing separate values into the TLS PRF to ensure that the * than passing separate values into the TLS PRF to ensure that the
...@@ -729,7 +724,6 @@ int tls1_export_keying_material(SSL *s, unsigned char *out, size_t olen, ...@@ -729,7 +724,6 @@ int tls1_export_keying_material(SSL *s, unsigned char *out, size_t olen,
rv = 0; rv = 0;
ret: ret:
OPENSSL_clear_free(val, vallen); OPENSSL_clear_free(val, vallen);
OPENSSL_clear_free(buff, olen);
return (rv); return (rv);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册