Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2019-03-07 00:17:32 +0300
committerCorinna Vinschen <corinna@vinschen.de>2019-03-07 00:19:16 +0300
commit094a2a17ad1cd65909fa2eee648d049d8d69fc45 (patch)
tree7f5bd2a703748a44014334efc4b63f86c27e947c
parent633278b877e0cb60956ce6da2f795f534ec9b5bc (diff)
Cygwin: posix timers: fix resource leak
On setting the timer, the thread is accidentally only canceled when disarming the timer. This leaks one thread per timer_settimer call. Move the thread cancellation where it belongs. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--winsup/cygwin/posix_timer.cc2
-rw-r--r--winsup/cygwin/release/3.0.313
2 files changed, 14 insertions, 1 deletions
diff --git a/winsup/cygwin/posix_timer.cc b/winsup/cygwin/posix_timer.cc
index d9d4a9a18..a140b00e9 100644
--- a/winsup/cygwin/posix_timer.cc
+++ b/winsup/cygwin/posix_timer.cc
@@ -287,9 +287,9 @@ timer_tracker::settime (int flags, const itimerspec *new_value,
if (old_value)
gettime (old_value, false);
+ cancel ();
if (!new_value->it_value.tv_sec && !new_value->it_value.tv_nsec)
{
- cancel ();
memset (&time_spec, 0, sizeof time_spec);
interval = 0;
exp_ts = 0;
diff --git a/winsup/cygwin/release/3.0.3 b/winsup/cygwin/release/3.0.3
new file mode 100644
index 000000000..66ae63943
--- /dev/null
+++ b/winsup/cygwin/release/3.0.3
@@ -0,0 +1,13 @@
+What's new:
+-----------
+
+
+What changed:
+-------------
+
+
+Bug Fixes
+---------
+
+- Fix a resource leak in posix timers.
+ Addresses: https://cygwin.com/ml/cygwin/2019-03/msg00120.html