Skip to content

Commit

Permalink
Fix double-free in lib/hx509/crypto.c
Browse files Browse the repository at this point in the history
  • Loading branch information
nicowilliams committed Apr 15, 2016
1 parent 6bbe7f0 commit 9df8820
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/hx509/crypto.c
Expand Up @@ -438,7 +438,7 @@ ecdsa_create_signature(hx509_context context,
ret = set_digest_alg(signatureAlgorithm, sig_oid, "\x05\x00", 2);
if (ret) {
hx509_clear_error_string(context);
goto error;
return ret;
}
}

Expand All @@ -448,11 +448,8 @@ ecdsa_create_signature(hx509_context context,
data,
NULL,
&indata);
if (ret) {
if (signatureAlgorithm)
free_AlgorithmIdentifier(signatureAlgorithm);
if (ret)
goto error;
}

sig->length = ECDSA_size(signer->private_key.ecdsa);
sig->data = malloc(sig->length);
Expand Down

0 comments on commit 9df8820

Please sign in to comment.