From d1fabea042633f0640d15c695983a4f2cfd86c0e Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Mon, 27 Jul 2015 13:46:20 +0300 Subject: [PATCH] [FIX] memory leak in nsp Change-Id: I34d5b3f7f92739bb92acd6706991cbe28549d4f7 Signed-off-by: Vyacheslav Cherkashin --- nsp/nsp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nsp/nsp.c b/nsp/nsp.c index 0f404a9..3a0fc6f 100644 --- a/nsp/nsp.c +++ b/nsp/nsp.c @@ -102,6 +102,17 @@ static struct dentry *lpad_dentry; static const char *libappcore_path; static struct dentry *libappcore_dentry; +static void uninit_variables(void) +{ + kfree(lpad_path); + lpad_path = NULL; + lpad_dentry = NULL; + + kfree(libappcore_path); + libappcore_path = NULL; + libappcore_dentry = NULL; +} + static bool is_init(void) { return lpad_dentry && libappcore_dentry; @@ -780,4 +791,6 @@ void nsp_exit(void) { if (stat == NS_ON) set_stat_off(); + + uninit_variables(); } -- 2.7.4