Fix svace issue
[platform/core/graphics/cairo.git] / src / cairo-truetype-subset.c
index 17e33ae..4d58080 100644 (file)
@@ -187,7 +187,7 @@ _cairo_truetype_font_create (cairo_scaled_font_subset_t  *scaled_font_subset,
     if (unlikely (status))
        return status;
 
-    font = malloc (sizeof (cairo_truetype_font_t));
+    font = _cairo_malloc (sizeof (cairo_truetype_font_t));
     if (unlikely (font == NULL))
        return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 
@@ -236,7 +236,7 @@ _cairo_truetype_font_create (cairo_scaled_font_subset_t  *scaled_font_subset,
 
     /* If the PS name is not found, create a CairoFont-x-y name. */
     if (font->base.ps_name == NULL) {
-        font->base.ps_name = malloc (30);
+        font->base.ps_name = _cairo_malloc (30);
         if (unlikely (font->base.ps_name == NULL)) {
            status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
             goto fail3;
@@ -611,7 +611,7 @@ cairo_truetype_font_write_glyf_table (cairo_truetype_font_t *font,
     else
        size = sizeof (int32_t) * (font->num_glyphs_in_face + 1);
 
-    u.bytes = malloc (size);
+    u.bytes = _cairo_malloc (size);
     if (unlikely (u.bytes == NULL))
        return _cairo_truetype_font_set_error (font, CAIRO_STATUS_NO_MEMORY);
 
@@ -1174,7 +1174,7 @@ cairo_truetype_subset_init_internal (cairo_truetype_subset_t     *truetype_subse
     truetype_subset->descent = (double)font->base.descent/font->base.units_per_em;
 
     if (length) {
-       truetype_subset->data = malloc (length);
+       truetype_subset->data = _cairo_malloc (length);
        if (unlikely (truetype_subset->data == NULL)) {
            status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
            goto fail4;
@@ -1187,7 +1187,7 @@ cairo_truetype_subset_init_internal (cairo_truetype_subset_t     *truetype_subse
 
     if (num_strings) {
        offsets_length = num_strings * sizeof (unsigned long);
-       truetype_subset->string_offsets = malloc (offsets_length);
+       truetype_subset->string_offsets = _cairo_malloc (offsets_length);
        if (unlikely (truetype_subset->string_offsets == NULL)) {
            status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
            goto fail5;
@@ -1446,7 +1446,7 @@ find_name (tt_name_t *name, int name_id, int platform, int encoding, int languag
        for (i = 0; i < u_len; i++)
            size += _cairo_ucs4_to_utf8 (be16_to_cpu(u[i]), NULL);
 
-       utf8 = malloc (size + 1);
+       utf8 = _cairo_malloc (size + 1);
        if (utf8 == NULL) {
            status =_cairo_error (CAIRO_STATUS_NO_MEMORY);
            goto fail;
@@ -1481,7 +1481,7 @@ find_name (tt_name_t *name, int name_id, int platform, int encoding, int languag
        }
     }
     if (has_tag) {
-       p = malloc (len - 6);
+       p = _cairo_malloc (len - 6);
        if (unlikely (p == NULL)) {
            status =_cairo_error (CAIRO_STATUS_NO_MEMORY);
            goto fail;
@@ -1526,7 +1526,7 @@ _cairo_truetype_read_font_name (cairo_scaled_font_t        *scaled_font,
     if (status)
        return status;
 
-    name = malloc (size);
+    name = _cairo_malloc (size);
     if (name == NULL)
         return _cairo_error (CAIRO_STATUS_NO_MEMORY);