From: Florian Forster Date: Sun, 6 Sep 2009 15:06:56 +0000 (+0200) Subject: src/utils_cache.c: Fix a very rare deadlock situation. X-Git-Tag: collectd-4.8.0~8 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4b357298a23cfb0583851e7cd5cc937470949623;p=collectd.git src/utils_cache.c: Fix a very rare deadlock situation. Only happened in an out-of-memory situation. Still, not nice ;) --- diff --git a/src/utils_cache.c b/src/utils_cache.c index 9e7bc067..648c54de 100644 --- a/src/utils_cache.c +++ b/src/utils_cache.c @@ -1003,6 +1003,9 @@ static meta_data_t *uc_get_meta (const value_list_t *vl) /* {{{ */ if (ce->meta == NULL) ce->meta = meta_data_create (); + if (ce->meta == NULL) + pthread_mutex_unlock (&cache_lock); + return (ce->meta); } /* }}} meta_data_t *uc_get_meta */