From: Svetlana Shmidt Date: Tue, 15 Sep 2020 11:01:57 +0000 (+0000) Subject: change format X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F3570%2Fhead;p=thirdparty%2Fcollectd.git change format --- diff --git a/src/daemon/utils_cache.c b/src/daemon/utils_cache.c index a90261289..bfa6d133b 100644 --- a/src/daemon/utils_cache.c +++ b/src/daemon/utils_cache.c @@ -676,19 +676,20 @@ int uc_get_start_value_by_name(const char *name, value_t *ret_start_value, cache_entry_t *ce = NULL; int status = 0; - if (c_avl_get(cache_tree, name, (void *)&ce) == 0) { - assert(ce != NULL); - - /* remove missing values from getval */ - if (ce->state == STATE_MISSING) { - status = -1; - } else { - *ret_start_value = typed_value_clone(ce->start_value).value; - *ret_start_time = ce->start_time; - } - } else { + if (c_avl_get(cache_tree, name, (void *)&ce) != 0) { DEBUG("utils_cache: uc_get_start_value_by_name: No such value: %s", name); status = -1; + pthread_mutex_unlock(&cache_lock); + return status; + } + assert(ce != NULL); + + /* remove missing values from getval */ + if (ce->state == STATE_MISSING) { + status = -1; + } else { + *ret_start_value = typed_value_clone(ce->start_value).value; + *ret_start_time = ce->start_time; } pthread_mutex_unlock(&cache_lock);