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 mismatched delete[] in src/node_file.cc #1092

Merged
merged 2 commits into from
Mar 7, 2015

Commits on Mar 7, 2015

  1. src: fix mismatched delete[] in src/node_file.cc

    Fix a bad delete of a pointer that was allocated with placement new.
    Casting the pointer was not the right solution because there was at
    least one non-placement new constructor call.
    
    This commit rewrites FSReqWrap to be more explicit about ownership of
    the auxiliary data and removes a number of egregious const_casts.
    The ASYNC_DEST_CALL macro also gets significantly slimmed down.
    
    PR-URL: nodejs#1092
    Reviewed-By: Fedor Indutny <fedor@indutny.com>
    bnoordhuis committed Mar 7, 2015
    Configuration menu
    Copy the full SHA
    648fc63 View commit details
    Browse the repository at this point in the history
  2. src: fix memory leak in fs.writeSync error path

    The SYNC_CALL macro returns on error, bypassing the delete[] call.
    
    Mea culpa, it looks like I introduced this memory leak back in 2013,
    in commit d2b80b8 ("src: clean up FSReqWrap").
    
    PR-URL: nodejs#1092
    Reviewed-By: Fedor Indutny <fedor@indutny.com>
    bnoordhuis committed Mar 7, 2015
    Configuration menu
    Copy the full SHA
    528d878 View commit details
    Browse the repository at this point in the history