* src/cff/cffdrivr.c (cff_ps_get_font_{info,extra}): Use FT_QNEW.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index 9bde3c7..b33435b 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -473,12 +473,12 @@
if ( cff && !cff->font_info )
{
- CFF_FontRecDict dict = &cff->top_font.font_dict;
- PS_FontInfoRec *font_info = NULL;
- FT_Memory memory = face->root.memory;
+ CFF_FontRecDict dict = &cff->top_font.font_dict;
+ FT_Memory memory = face->root.memory;
+ PS_FontInfoRec* font_info;
- if ( FT_QALLOC( font_info, sizeof ( *font_info ) ) )
+ if ( FT_QNEW( font_info ) )
goto Fail;
font_info->version = cff_index_get_sid_string( cff,
@@ -515,15 +515,15 @@
FT_Error error = FT_Err_Ok;
- if ( cff && cff->font_extra == NULL )
+ if ( cff && !cff->font_extra )
{
- CFF_FontRecDict dict = &cff->top_font.font_dict;
- PS_FontExtraRec* font_extra = NULL;
- FT_Memory memory = face->root.memory;
+ CFF_FontRecDict dict = &cff->top_font.font_dict;
+ FT_Memory memory = face->root.memory;
+ PS_FontExtraRec* font_extra;
FT_String* embedded_postscript;
- if ( FT_ALLOC( font_extra, sizeof ( *font_extra ) ) )
+ if ( FT_QNEW( font_extra ) )
goto Fail;
font_extra->fs_type = 0U;