if ((struct_ptr = (png_voidp)halloc(size,1)) != NULL)
struct_ptr = (png_voidp)halloc(size,1);
png_create_struct(int type){#ifdef PNG_USER_MEM_SUPPORTED   return (png_create_struct_2(type, png_malloc_ptr_NULL, png_voidp_NULL));}/* Allocate memory for a png_struct or a png_info.  The malloc and   memset can be replaced by a single call to calloc() if this is thought   to improve performance noticably. */png_voidp /* PRIVATE */png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr){#endif /* PNG_USER_MEM_SUPPORTED */   png_size_t size;   png_voidp struct_ptr;   if (type == PNG_STRUCT_INFO)      size = sizeof(png_info);   else if (type == PNG_STRUCT_PNG)      size = sizeof(png_struct);   else      return (NULL);#ifdef PNG_USER_MEM_SUPPORTED   if(malloc_fn != NULL)   {      png_struct dummy_struct;      png_structp png_ptr = &dummy_struct;      png_ptr->mem_ptr=mem_ptr;      struct_ptr = (*(malloc_fn))(png_ptr, size);      if (struct_ptr != NULL)         png_memset(struct_ptr, 0, size);      return (struct_ptr);   }#endif /* PNG_USER_MEM_SUPPORTED */#if defined(__TURBOC__) && !defined(__FLAT__)   if ((struct_ptr = (png_voidp)farmalloc(size)) != NULL)#else# if defined(_MSC_VER) && defined(MAXSEG_64K)   if ((struct_ptr = (png_voidp)halloc(size,1)) != NULL)# else   if ((struct_ptr = (png_voidp)malloc(size)) != NULL)# endif#endif   {      png_memset(struct_ptr, 0, size);   }   return (struct_ptr);}