If the malloc fails, memset would touch invalid memory. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>