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

src: fix memory leaks and refactor ByteSource #43202

Merged

Commits on Jun 10, 2022

  1. src: fix memory leaks and refactor ByteSource

    Add ByteSource::Builder to replace the common MallocOpenSSL() +
    ByteSource::Allocated() pattern.
    
    Remove ByteSource::reset() that is unused.
    
    Remove ByteSource::Resize() to make ByteSource truly immutable (until
    moved away). Instead, ByteSource::Builder::release() takes an optional
    size argument that truncates the resulting ByteSource.
    
    Fix occurrences of MallocOpenSSL() that do not always free the allocated
    memory by using the new ByteSource::Builder class instead.
    
    Remove ByteSource::get() and replace uses with ByteSource::data().
    
    Remove ReallocOpenSSL() because it likely only saves us a few bytes
    whenever we use it.
    tniessen committed Jun 10, 2022
    Configuration menu
    Copy the full SHA
    118e58c View commit details
    Browse the repository at this point in the history