fixing compiler errors on VDX adding memory leak in  control.c