GK taking freekicks isn't unheard of in many professional league. GK don't need to run a lot compared to other positions so they are likely able to deliver powerful kicks late in the game.

Corner kick however, would be ridiculous. Who would run 80m just to kick one, and run another 80m back to his own goal?