diff options
author | Ori Shalev <orish@fb.com> | 2018-03-24 16:11:38 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2018-03-24 23:28:35 -0700 |
commit | 583c8177ada2f6fcfa556140b94b019d31588e4a (patch) | |
tree | dc787a720a6a1b6e403485933416b9c851f5bcc9 /extstore.c | |
parent | 7ff49d49de14856c0ec3f6c828ff2089fcc8425c (diff) | |
download | memcached-583c8177ada2f6fcfa556140b94b019d31588e4a.tar.gz |
Bugfix: missing initialization code for extstore maint thread objects
The extstore maintenance thread takes permanent ownership of its mutex.
Grabbing an uninitialized mutex can result in undefined behavior. In
this case the memory is zeroed so probably no harm.
Diffstat (limited to 'extstore.c')
-rw-r--r-- | extstore.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -305,6 +305,8 @@ void *extstore_init(char *fn, struct extstore_conf *cf, e->maint_thread = calloc(1, sizeof(store_maint_thread)); e->maint_thread->e = e; // FIXME: error handling + pthread_mutex_init(&e->maint_thread->mutex, NULL); + pthread_cond_init(&e->maint_thread->cond, NULL); pthread_create(&thread, NULL, extstore_maint_thread, e->maint_thread); return (void *)e; |