# Energy not conserved if mass is variable

In classical Mechanics it is possible to prove that the total Energy $$E = T + V$$ is conserved if the force is conservative. However, if you assume the mass is time-dependent this proof no longer holds:

\begin{align} \frac{dE}{dt} = \frac{d}{dt}(\frac{1}{2}m\dot{\vec{r}}^2 + V) = \frac{\dot{m}}{2}\dot{\vec{r}}^2+m\dot{\vec{r}}\cdot \ddot{\vec{r}}+\frac{dV}{dt} \end{align}

Furthermore, $$\frac{dV}{dt} = \dot{\vec{r}} \cdot \nabla V = - \dot{\vec{r}} \cdot\vec{F} = -\dot{\vec{r}} \cdot\left(\dot{m} \dot{\vec{r}} + m \ddot{\vec{r}} \right)$$ under the assumption that the mass is time-dependent. Therfore, weg get

\begin{align} \frac{dE}{dt} = \frac{\dot{m}}{2}\dot{\vec{r}}^2+m\dot{\vec{r}}\cdot \ddot{\vec{r}} -\dot{\vec{r}} \cdot\left(\dot{m} \dot{\vec{r}} + m \ddot{\vec{r}} \right) = -\frac{\dot{m}}{2} \dot{\vec{r}}^2 \end{align}

So is there a flaw in this reasoning, or is energy (for conservative forces) only conserved if mass is time-independent?