[FREETYPE] Handle allocation failures in our stack-saving hacks. CORE-15642
[reactos.git] / sdk / lib / 3rdparty / freetype / src / cid / cidgload.c
index dbc116c..4ae2e05 100644 (file)
     FT_Error       error;
 #ifdef __REACTOS__
     T1_DecoderRec *decoder = malloc(sizeof(T1_DecoderRec));
+    if (!decoder) return FT_Err_Out_Of_Memory;
 /* Ugly but it allows us to reduce the diff */
 #define decoder (*decoder)
+    {
 #else
     T1_DecoderRec  decoder;
 #endif
 #ifdef __REACTOS__
     free(&decoder);
 #undef decoder
+    }
 #endif
     return error;
   }