From f06b16f2e9e89e9d131dacb380ba321867823001 Mon Sep 17 00:00:00 2001 From: Ali Ijaz Sheikh Date: Wed, 25 Mar 2015 12:19:46 -0700 Subject: [PATCH] src: fix minor memleak in preload-modules Free the preload_modules array once we are done with it. PR-URL: https://github.com/iojs/io.js/pull/1265 Reviewed-By: Ben Noordhuis --- src/node.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/node.cc b/src/node.cc index e82ea37c1abef8..02df0d8a5b25c3 100644 --- a/src/node.cc +++ b/src/node.cc @@ -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