From d23dc2c183d19496e279295ee2c0901b3bf05ec7 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 2 Aug 2022 09:39:15 -0700 Subject: [PATCH] cache: don't try to remove packages from the cache if it's NULL Otherwise we end up reallocing the cache_table, when we shouldn't --- libpkgconf/cache.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libpkgconf/cache.c b/libpkgconf/cache.c index c89b85c..4fe2056 100644 --- a/libpkgconf/cache.c +++ b/libpkgconf/cache.c @@ -153,6 +153,9 @@ pkgconf_cache_remove(pkgconf_client_t *client, pkgconf_pkg_t *pkg) if (pkg == NULL) return; + if (client->cache_table == NULL) + return; + if (!(pkg->flags & PKGCONF_PKG_PROPF_CACHED)) return;