renderer: malloc checks