Stop gap

Where does the expression 'stop gap' come from?

Stopgap is a single word. The earliest citation is 1684. The meaning comes from something that fills in a hole quickly - a stop/stopper in a gap.