avoiding to free stack-variables

### Descripton
Reopened the branch of 'stupid leak' as the fix tried to free not only allocated variables but also a few variables on the stack ...