From 9d82962160a8ca042d5878f1afdefb27680b69c7 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 2 Aug 2022 11:51:29 -0700 Subject: [PATCH] fixup! cache: set the cache_table to NULL if empty --- libpkgconf/cache.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 *)); + } } /*