LM317 equivalent backfeeding
You need a diode to stop this .Its easiest to place the diode in series with the B pos output .If you use a schottky then the voltage wasted is not too bad .If you are worried about voltage drop then use a 40 Volt diode because it wastes less than say a 200 Volt type .