mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-29 09:34:05 +01:00
[wasm-graphite] Memory hygiene
This commit is contained in:
1 parent
faaae04359
commit
8215e70632
1 file changed
+4
@@ -117,7 +117,11 @@ shape (void *shape_plan,
|
||||
cluster_t *clusters = (cluster_t *) malloc (length * sizeof (cluster_t));
|
||||
uint32_t *gids = (uint32_t *) malloc (length * sizeof (uint32_t));
|
||||
if (!clusters || !gids)
|
||||
{
|
||||
free (clusters);
|
||||
free (gids);
|
||||
return false;
|
||||
}
|
||||
|
||||
memset (clusters, 0, sizeof (clusters[0]) * length);
|
||||
codepoint_t *pg = gids;
|
||||
|
||||
Reference in new issue
Block a user