maze create malloc safe