From c31c18bb9c4b8bcfb88c52abd2e39869aff815f3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 8 Mar 2006 11:57:41 -0500 Subject: [PATCH] BUG: Do not leak ps FILE when the process starts but reading the header fails. --- Source/kwsys/ProcessUNIX.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c index 7700ccf82..942325cf9 100644 --- a/Source/kwsys/ProcessUNIX.c +++ b/Source/kwsys/ProcessUNIX.c @@ -1997,8 +1997,11 @@ static void kwsysProcessKill(pid_t process_id) kwsysProcessKill(pid); } } + } - /* We are done with the ps process. */ + /* We are done with the ps process. */ + if(ps) + { pclose(ps); } }