Skip to content

Commit

Permalink
src: fix minor memleak in preload-modules
Browse files Browse the repository at this point in the history
Free the preload_modules array once we are done with it.

PR-URL: #1265
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
ofrobots authored and bnoordhuis committed Mar 28, 2015
1 parent 19641b1 commit f06b16f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2761,6 +2761,10 @@ void SetupProcessObject(Environment* env,
READONLY_PROPERTY(process,
"_preload_modules",
array);

delete[] preload_modules;
preload_modules = nullptr;
preload_module_count = 0;
}

// --no-deprecation
Expand Down

0 comments on commit f06b16f

Please sign in to comment.