Fix memory leak in integral calculator.