fixup! cache: set the cache_table to NULL if empty

Dylan Baker 2022-08-02 11:51:29 -07:00
parent 0c72b7cd41
commit 9d82962160
1 changed files with 5 additions and 1 deletions

View File

@ -186,12 +186,16 @@ pkgconf_cache_remove(pkgconf_client_t *client, pkgconf_pkg_t *pkg)
} }
client->cache_count--; client->cache_count--;
if (client->cache_count == 0) if (client->cache_count == 0) {
free(client->cache_table);
client->cache_table = NULL; client->cache_table = NULL;
}
else else
{
client->cache_table = pkgconf_reallocarray(client->cache_table, client->cache_table = pkgconf_reallocarray(client->cache_table,
client->cache_count, sizeof(void *)); client->cache_count, sizeof(void *));
} }
}
/* /*
* !doc * !doc