fixed a memory leak in imc|imv_agent