You definitely shouldn't use a rag as a stopper for your glass bottle full of gasoline, especially if you might need to throw it away from you in the event the rag spontaneously combusts.
It would be much safer for the bottle to be sealed so the fuel inside doesn't ignite until it's further away from you.