forked from ariadne/pkgconf
cache: use pkgconf_reallocarray stub
parent
c1579d381c
commit
ffa0805d58
|
@ -128,7 +128,7 @@ pkgconf_cache_add(pkgconf_client_t *client, pkgconf_pkg_t *pkg)
|
||||||
pkg->flags |= PKGCONF_PKG_PROPF_CACHED;
|
pkg->flags |= PKGCONF_PKG_PROPF_CACHED;
|
||||||
|
|
||||||
++client->cache_count;
|
++client->cache_count;
|
||||||
client->cache_table = reallocarray(client->cache_table,
|
client->cache_table = pkgconf_reallocarray(client->cache_table,
|
||||||
client->cache_count, sizeof (void *));
|
client->cache_count, sizeof (void *));
|
||||||
client->cache_table[client->cache_count - 1] = pkg;
|
client->cache_table[client->cache_count - 1] = pkg;
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ pkgconf_cache_remove(pkgconf_client_t *client, pkgconf_pkg_t *pkg)
|
||||||
}
|
}
|
||||||
|
|
||||||
client->cache_count--;
|
client->cache_count--;
|
||||||
client->cache_table = reallocarray(client->cache_table,
|
client->cache_table = pkgconf_reallocarray(client->cache_table,
|
||||||
client->cache_count, sizeof(void *));
|
client->cache_count, sizeof(void *));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ pkgconf_cache_free(pkgconf_client_t *client)
|
||||||
pkgconf_pkg_t **cache_table;
|
pkgconf_pkg_t **cache_table;
|
||||||
size_t i, count;
|
size_t i, count;
|
||||||
|
|
||||||
cache_table = reallocarray(NULL, client->cache_count, sizeof (void *));
|
cache_table = pkgconf_reallocarray(NULL, client->cache_count, sizeof (void *));
|
||||||
memcpy(cache_table, client->cache_table,
|
memcpy(cache_table, client->cache_table,
|
||||||
client->cache_count * sizeof (void *));
|
client->cache_count * sizeof (void *));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue