diff --git a/libpkgconf/cache.c b/libpkgconf/cache.c index 03ee0e4..673ac48 100644 --- a/libpkgconf/cache.c +++ b/libpkgconf/cache.c @@ -186,11 +186,15 @@ pkgconf_cache_remove(pkgconf_client_t *client, pkgconf_pkg_t *pkg) } client->cache_count--; - if (client->cache_count == 0) + if (client->cache_count == 0) { + free(client->cache_table); client->cache_table = NULL; + } else + { client->cache_table = pkgconf_reallocarray(client->cache_table, client->cache_count, sizeof(void *)); + } } /*