[FIX] memory leak in nsp 75/44775/2
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 27 Jul 2015 10:46:20 +0000 (13:46 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 27 Jul 2015 13:35:21 +0000 (06:35 -0700)
Change-Id: I34d5b3f7f92739bb92acd6706991cbe28549d4f7
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
nsp/nsp.c

index 0f404a9..3a0fc6f 100644 (file)
--- 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();
 }