From 594e9de349783ee869b959a68d444934e16ce487 Mon Sep 17 00:00:00 2001 From: "Bradford D. Boyle" Date: Sun, 10 Jun 2018 22:28:22 -0700 Subject: [PATCH] Change return type of `remove_thread()` to void Flowing off the end of a function is undefined behavior. On Fedora 28, the `nmux` program would segfault when this function returned. --- tsmpool.cpp | 2 +- tsmpool.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tsmpool.cpp b/tsmpool.cpp index d70e8bae..7c8f88f2 100644 --- a/tsmpool.cpp +++ b/tsmpool.cpp @@ -42,7 +42,7 @@ tsmthread_t* tsmpool::register_thread() return thread; } -int tsmpool::remove_thread(tsmthread_t* thread) +void tsmpool::remove_thread(tsmthread_t* thread) { pthread_mutex_lock(&this->mutex); for(int i=0;i