diff --git a/src/hb-face.cc b/src/hb-face.cc index 7aa89fcadb50c3c14a51a2ef684339ee5016ca56..9effc41c8878851b7ebcf773d114877a26dcca01 100644 --- a/src/hb-face.cc +++ b/src/hb-face.cc @@ -113,7 +113,7 @@ _hb_face_for_data_closure_create (hb_blob_t *blob, unsigned int index) { hb_face_for_data_closure_t *closure; - closure = (hb_face_for_data_closure_t *) malloc (sizeof (hb_face_for_data_closure_t)); + closure = (hb_face_for_data_closure_t *) calloc (1, sizeof (hb_face_for_data_closure_t)); if (unlikely (!closure)) return NULL; diff --git a/src/hb-shape-plan.cc b/src/hb-shape-plan.cc index 1d94c520bd427e926d5b53706e8d234fea79537f..56e2ea5c19254c1f94e696efba5b01151446ec66 100644 --- a/src/hb-shape-plan.cc +++ b/src/hb-shape-plan.cc @@ -128,7 +128,7 @@ hb_shape_plan_create (hb_face_t *face, face = hb_face_get_empty (); if (unlikely (!props)) return hb_shape_plan_get_empty (); - if (num_user_features && !(features = (hb_feature_t *) malloc (num_user_features * sizeof (hb_feature_t)))) + if (num_user_features && !(features = (hb_feature_t *) calloc (num_user_features, sizeof (hb_feature_t)))) return hb_shape_plan_get_empty (); if (!(shape_plan = hb_object_create ())) { free (features); diff --git a/src/hb-shaper.cc b/src/hb-shaper.cc index 580b95c84b4d0d30d9da923a6349d6a34a3ebeb6..b25566d8a7cf0e662bf3c1962b5026795e3ef7a0 100644 --- a/src/hb-shaper.cc +++ b/src/hb-shaper.cc @@ -64,7 +64,7 @@ retry: } /* Not found; allocate one. */ - shapers = (hb_shaper_pair_t *) malloc (sizeof (all_shapers)); + shapers = (hb_shaper_pair_t *) calloc (1, sizeof (all_shapers)); if (unlikely (!shapers)) { (void) hb_atomic_ptr_cmpexch (&static_shapers, NULL, &all_shapers[0]); return (const hb_shaper_pair_t *) all_shapers;