diff options
author | neal-zhu <13126959424@163.com> | 2019-10-14 15:01:04 +0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2019-10-17 14:17:53 -0700 |
commit | d711d1379a7acac5a34832d0d2c6ec8112e763aa (patch) | |
tree | 857f67a8863aa82061b1e31c1c015279c16da87d /logger.c | |
parent | ebfa600e23df19a29dc82a9ab308833641d3cdf4 (diff) | |
download | memcached-d711d1379a7acac5a34832d0d2c6ec8112e763aa.tar.gz |
fix potential deadlock bug in log watcher
If too many watchers exist, fails to release logger stack lock.
Diffstat (limited to 'logger.c')
-rw-r--r-- | logger.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -805,6 +805,7 @@ enum logger_add_watcher_ret logger_add_watcher(void *c, const int sfd, uint16_t logger_watcher *w = NULL; pthread_mutex_lock(&logger_stack_lock); if (watcher_count >= WATCHER_LIMIT) { + pthread_mutex_unlock(&logger_stack_lock); return LOGGER_ADD_WATCHER_TOO_MANY; } |