LOGISTIC REGRESSION: Fix memory leak in error path