cache: Fix memory leaks.
commit4394b6859d32e6c100148c25c9a8fe57d4ce208c
authorBen Kibbey <bjk@luxsci.net>
Wed, 15 Mar 2023 03:36:17 +0000 (14 20:36 -0700)
committerBen Kibbey <bjk@luxsci.net>
Wed, 15 Mar 2023 03:36:17 +0000 (14 20:36 -0700)
tree3b50dad7e545bfb2c70bdd08fb4f94928cf1bc85
parentb17b34f6d2ab50390d134f7228e14cef2f2afb86
cache: Fix memory leaks.

When re-opening a new data file the refcount wasn't getting decremented.

Also, in the case that clear_once() fails, keep the cache entry until
the cache data can be cleared which may occur during the next
cache_adjust_timeout() interval rather than freeing the cache entry but
not the data.
src/cache.c
src/cache.h
src/commands.c
src/pwmd.c