core: fix memory leak in evaluation of sub-conditions
core: fix memory leak when removing a hdata
core: fix memory in execution of commands

This memory leak was introduced by commit aa81067ad070f05a4aaf98383781eba0fbafefd6