New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release memory in case of error in the OpenSSL ECDSA constructor #6917

Merged
merged 1 commit into from Sep 4, 2018

Conversation

Projects
None yet
3 participants
@rgacogne
Member

rgacogne commented Sep 3, 2018

Short description

The current code will only fail to release the allocated memory if called with an invalid algorithm, which won't happen, or if a memory allocation fails in which case this might not matter much.
Still, it's cleaner to release the memory properly and might avoid mistakes later if we look at this code while implementing a new crypto backend.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)
Release memory in case of error in the OpenSSL ECDSA constructor
The current code will only fail to release the allocated memory if
called with an invalid algorithm, which won't happen, or if a
memory allocation fails in which case this might not matter much.
Still, it's cleaner to release the memory properly and might avoid
mistakes later if we look at this code while implementing a new
crypto backend.
@pieterlexis

lgtm!

@rgacogne rgacogne merged commit 8ea900a into PowerDNS:master Sep 4, 2018

4 checks passed

LGTM analysis: C/C++ No alert changes
Details
LGTM analysis: JavaScript No alert changes
Details
LGTM analysis: Python No alert changes
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@rgacogne rgacogne deleted the rgacogne:ecdsa-signer-leak-oom branch Sep 4, 2018

rgacogne added a commit to rgacogne/pdns that referenced this pull request Oct 31, 2018

rgacogne added a commit to rgacogne/pdns that referenced this pull request Oct 31, 2018

This was referenced Oct 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment