From 1962d8158b1ec2303a3bd8b40b1ecbae61a305a0 Mon Sep 17 00:00:00 2001
From: Danny Auble <da@llnl.gov>
Date: Mon, 31 Jan 2011 22:54:05 +0000
Subject: [PATCH] handle memory leak

---
 src/sbatch/mult_cluster.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/sbatch/mult_cluster.c b/src/sbatch/mult_cluster.c
index 437618190d6..cd0dd3f7f93 100644
--- a/src/sbatch/mult_cluster.c
+++ b/src/sbatch/mult_cluster.c
@@ -191,7 +191,8 @@ extern int sbatch_set_first_avail_cluster(job_desc_msg_t *req)
 
 	if (!list_count(ret_list)) {
 		error("Can't run on any of the clusters given");
-		return SLURM_ERROR;
+		rc = SLURM_ERROR;
+		goto end_it;
 	}
 
 	/* sort the list so the first spot is on top */
@@ -202,6 +203,7 @@ extern int sbatch_set_first_avail_cluster(job_desc_msg_t *req)
 
 	/* set up the working cluster and be done */
 	working_cluster_rec = local_cluster->cluster_rec;
+end_it:
 	list_destroy(ret_list);
 
 	return rc;
-- 
GitLab