summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/ProcessUNIX.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-03-08 16:57:41 (GMT)
committerBrad King <brad.king@kitware.com>2006-03-08 16:57:41 (GMT)
commitc31c18bb9c4b8bcfb88c52abd2e39869aff815f3 (patch)
tree77612360ebc117dde5802f1eeca0beea54a3cf6f /Source/kwsys/ProcessUNIX.c
parenta155eacec38d3b326991dd32e07ec532dc0c36c0 (diff)
downloadCMake-c31c18bb9c4b8bcfb88c52abd2e39869aff815f3.zip
CMake-c31c18bb9c4b8bcfb88c52abd2e39869aff815f3.tar.gz
CMake-c31c18bb9c4b8bcfb88c52abd2e39869aff815f3.tar.bz2
BUG: Do not leak ps FILE when the process starts but reading the header fails.
Diffstat (limited to 'Source/kwsys/ProcessUNIX.c')
-rw-r--r--Source/kwsys/ProcessUNIX.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index 7700ccf..942325c 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);
}
}