added preprocessor if for different malloc versions