Use the routine CPXfreeprob() to destroy a problem object when your application no longer needs it.
CPXfreeprob()