Yes it's safe to leave your crockpot on warm overnight and they are made to do just that.
You can also leave the crockpot on high setting to cook the food overnight but just make sure you have enough water in the crockpot to avoid it drying out.
I usually get up overnight anyway to use the bathroom so I can check the crockpot and sometimes it's down a little bit on water so I just add a little more water to the crockpot.
Then I just go back to bed and in the morning I have food ready to eat.
I also leave the crockpot on while away from the house or when I'm gone to work so that I have food ready to eat when I return home from work.
That's one of the points of a crockpot is to slow cook the food while you're asleep or away from home and as long as the cord and crockpot is in good condition and you don't overload your electrical outlets the crockpot should be just fine.