Skip to content
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

Memory leak in cert_write example program #1422

Closed
hanno-becker opened this issue Mar 6, 2018 · 1 comment
Closed

Memory leak in cert_write example program #1422

hanno-becker opened this issue Mar 6, 2018 · 1 comment
Labels

Comments

@hanno-becker
Copy link

Issue: The programs/x509/cert_write example program doesn't free the CSR and issuer CRT structures csr resp. issuer_crt after use. Their initialization happens here and here, but the cleanup section omits them.

This leads to a memory leak when running programs/x509/cert_write with either the request_file or the issuer_crt argument set, as witnessed by a run with address sanitizer enabled.

@ciarmcom
Copy link

ciarmcom commented Mar 6, 2018

ARM Internal Ref: IOTSSL-2152

hanno-becker pushed a commit to hanno-becker/mbedtls that referenced this issue Oct 5, 2018
* The variables `csr` and `issuer_crt` are initialized but not freed.
* The variable `entropy` is unconditionally freed in the cleanup section
  but there's a conditional jump to that section before its initialization.
  This cmmot Moves it to the other initializations happening before the
  first conditional jump to the cleanup section.

Fixes Mbed-TLS#1422.
hanno-becker pushed a commit to hanno-becker/mbedtls that referenced this issue Oct 5, 2018
* The variables `csr` and `issuer_crt` are initialized but not freed.
* The variable `entropy` is unconditionally freed in the cleanup section
  but there's a conditional jump to that section before its initialization.
  This cmmot Moves it to the other initializations happening before the
  first conditional jump to the cleanup section.

Fixes Mbed-TLS#1422.
hanno-becker pushed a commit to hanno-becker/mbedtls that referenced this issue Oct 5, 2018
* The variables `csr` and `issuer_crt` are initialized but not freed.
* The variable `entropy` is unconditionally freed in the cleanup section
  but there's a conditional jump to that section before its initialization.
  This cmmot Moves it to the other initializations happening before the
  first conditional jump to the cleanup section.

Fixes Mbed-TLS#1422.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants