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: plug memory leaks #2352

Merged
merged 4 commits into from
Aug 13, 2015
Merged

Commits on Aug 13, 2015

  1. src: plug memory leaks

    In a few places dynamic memory was passed to the Buffer::New() overload
    that makes a copy of the input, not the one that takes ownership.
    
    This commit is a band-aid to fix the memory leaks.  Longer term, we
    should look into using C++11 move semantics more effectively.
    
    Fixes: nodejs#2308
    PR-URL: nodejs#2352
    Reviewed-By: Fedor Indutny <[email protected]>
    Reviewed-By: Trevor Norris <[email protected]>
    bnoordhuis committed Aug 13, 2015
    Configuration menu
    Copy the full SHA
    6457746 View commit details
    Browse the repository at this point in the history
  2. src: move internal functions out of node_buffer.h

    The circular dependency problem that put them there in the first place
    is no longer an issue.  Move them out of the public node_buffer.h header
    and into the private node_internals.h header.
    
    Fixes: nodejs#2308
    PR-URL: nodejs#2352
    Reviewed-By: Fedor Indutny <[email protected]>
    Reviewed-By: Trevor Norris <[email protected]>
    bnoordhuis committed Aug 13, 2015
    Configuration menu
    Copy the full SHA
    b86211a View commit details
    Browse the repository at this point in the history
  3. src: introduce internal Buffer::Copy() function

    Rename the three argument overload of Buffer::New() to Buffer::Copy()
    and update the code base accordingly.  The reason for renaming is to
    make it impossible to miss a call site.
    
    This coincidentally plugs a small memory leak in crypto.getAuthTag().
    
    Fixes: nodejs#2308
    PR-URL: nodejs#2352
    Reviewed-By: Fedor Indutny <[email protected]>
    Reviewed-By: Trevor Norris <[email protected]>
    bnoordhuis committed Aug 13, 2015
    Configuration menu
    Copy the full SHA
    9a3929d View commit details
    Browse the repository at this point in the history
  4. src: rename Buffer::Use() to Buffer::New()

    Fixes: nodejs#2308
    PR-URL: nodejs#2352
    Reviewed-By: Fedor Indutny <[email protected]>
    Reviewed-By: Trevor Norris <[email protected]>
    bnoordhuis committed Aug 13, 2015
    Configuration menu
    Copy the full SHA
    8841947 View commit details
    Browse the repository at this point in the history