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
Dylan Baker 2022-08-02 09:39:15 -07:00
parent a620e62286
commit d23dc2c183
1 changed files with 3 additions and 0 deletions

View File

@ -153,6 +153,9 @@ pkgconf_cache_remove(pkgconf_client_t *client, pkgconf_pkg_t *pkg)
if (pkg == NULL) if (pkg == NULL)
return; return;
if (client->cache_table == NULL)
return;
if (!(pkg->flags & PKGCONF_PKG_PROPF_CACHED)) if (!(pkg->flags & PKGCONF_PKG_PROPF_CACHED))
return; return;