GH735: remove unnecessary allocation
[openssl.git] / ssl / t1_enc.c
index 6b3a73e39e60c185ac25ab5029d7d599e0e579e3..1b2820bff9afd7966e224123df09e8f70fd13588 100644 (file)
@@ -648,15 +648,10 @@ int tls1_export_keying_material(SSL *s, unsigned char *out, size_t olen,
                                 const unsigned char *context,
                                 size_t contextlen, int use_context)
 {
-    unsigned char *buff;
     unsigned char *val = NULL;
     size_t vallen = 0, currentvalpos;
     int rv;
 
-    buff = OPENSSL_malloc(olen);
-    if (buff == NULL)
-        goto err2;
-
     /*
      * construct PRF arguments we construct the PRF argument ourself rather
      * 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,
     rv = 0;
  ret:
     OPENSSL_clear_free(val, vallen);
-    OPENSSL_clear_free(buff, olen);
     return (rv);
 }