You should change this so it doesnt check for null before the free. free
handles NULL.
On 31 May 2014 16:39, "Brent Cook" <bust...@gmail.com> wrote:

> ---
>  ecdh/ecdhtest.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ecdh/ecdhtest.c b/ecdh/ecdhtest.c
> index 620424d..ee220dc 100644
> --- a/ecdh/ecdhtest.c
> +++ b/ecdh/ecdhtest.c
> @@ -358,7 +358,7 @@ static int ecdh_kat(BIO *out, const char *cname, int
> nid,
>         Ztmplen = (EC_GROUP_get_degree(EC_KEY_get0_group(key1)) + 7)/8;
>         if (Ztmplen != Zlen)
>                 goto err;
> -       Ztmp = OPENSSL_malloc(Ztmplen);
> +       Ztmp = malloc(Ztmplen);
>         if (!ECDH_compute_key(Ztmp, Ztmplen,
>                                 EC_KEY_get0_public_key(key2), key1, 0))
>                 goto err;
> @@ -377,7 +377,7 @@ static int ecdh_kat(BIO *out, const char *cname, int
> nid,
>         if (key2)
>                 EC_KEY_free(key2);
>         if (Ztmp)
> -               OPENSSL_free(Ztmp);
> +               free(Ztmp);
>         if (rv)
>                 BIO_puts(out, " ok\n");
>         else
> --
> 1.9.3
>
>

Reply via email to