Regulator cooling in a confined space
The regulator should have thermal limiting (check the data sheet for details), and will shut down if the temperature gets too high. It won't damage any other parts, and definitely won't melt any solder!

Using a larger heatsink will reduce the temperature, of course. A switching regulator will be a lot more efficient and will just get slightly warm.