aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2019-03-06 22:17:32 +0100
committerCorinna Vinschen <corinna@vinschen.de>2019-03-06 22:19:16 +0100
commit094a2a17ad1cd65909fa2eee648d049d8d69fc45 (patch)
tree7f5bd2a703748a44014334efc4b63f86c27e947c
parent633278b877e0cb60956ce6da2f795f534ec9b5bc (diff)
downloadnewlib-094a2a17ad1cd65909fa2eee648d049d8d69fc45.zip
newlib-094a2a17ad1cd65909fa2eee648d049d8d69fc45.tar.gz
newlib-094a2a17ad1cd65909fa2eee648d049d8d69fc45.tar.bz2
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 d9d4a9a..a140b00 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 0000000..66ae639
--- /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