diff options
author | dormando <dormando@rydia.net> | 2016-12-16 01:02:41 -0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2016-12-16 01:02:41 -0800 |
commit | 34e4604dbe445e03449aece98a32af70b42d8d71 (patch) | |
tree | a2d5d66d61e60d9113c67c6b90d5f92b8dab52c4 /crawler.c | |
parent | 356ed3f99a1ce0bb0a656c44e34a9990729500cd (diff) | |
download | memcached-34e4604dbe445e03449aece98a32af70b42d8d71.tar.gz |
don't double free in lru_crawler on closed clients
during finalization, a poll and deliberate close are run. if a client is
closed during the poll it might double free.
Diffstat (limited to 'crawler.c')
-rw-r--r-- | crawler.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -402,7 +402,10 @@ static void *item_crawler_thread(void *arg) { active_crawler_mod.mod->finalize(&active_crawler_mod); if (active_crawler_mod.c.c != NULL) { lru_crawler_poll(&active_crawler_mod.c); - lru_crawler_release_client(&active_crawler_mod.c); + // Double checking in case the client closed during the poll + if (active_crawler_mod.c.c != NULL) { + lru_crawler_release_client(&active_crawler_mod.c); + } } active_crawler_mod.mod = NULL; } |