[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH] shell: Fix für Bug 39 - Speicherleck in ps/pstree



! ps und pstree geben den Speicher für die task_info wieder frei

Signed-off-by: Patrick Pokatilo <shyxormz@xxxxxxxxxx>
---
 src/modules/c/shell/cmds/ps.c     |    2 ++
 src/modules/c/shell/cmds/pstree.c |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/modules/c/shell/cmds/ps.c b/src/modules/c/shell/cmds/ps.c
index 2f1cc66..94e3843 100644
--- a/src/modules/c/shell/cmds/ps.c
+++ b/src/modules/c/shell/cmds/ps.c
@@ -105,6 +105,8 @@ void ps_display_usage(void);
         temp = NULL;
     }
 
+    mem_free(task_info, task_info->info_size);
+
     return EXIT_SUCCESS;
 }
 
diff --git a/src/modules/c/shell/cmds/pstree.c b/src/modules/c/shell/cmds/pstree.c
index ec7dded..4ff50ff 100644
--- a/src/modules/c/shell/cmds/pstree.c
+++ b/src/modules/c/shell/cmds/pstree.c
@@ -58,6 +58,7 @@ task_info_t* task_info;
     
     task_info = enumerate_tasks();
     pstree_show_children(0, 0);
+    mem_free(task_info, task_info->info_size);
     
     return EXIT_SUCCESS;
 }
-- 
1.7.0.4