From 80ab6ff4f2fe4886fbe9b7458c2c7af342e58284 Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Mon, 16 Mar 2015 10:22:43 +0100 Subject: [PATCH] Fixed memory leak issue with script_str variable --- src/plugins/jobcomp/elasticsearch/jobcomp_elasticsearch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/jobcomp/elasticsearch/jobcomp_elasticsearch.c b/src/plugins/jobcomp/elasticsearch/jobcomp_elasticsearch.c index 61518e1..d19cccd 100644 --- a/src/plugins/jobcomp/elasticsearch/jobcomp_elasticsearch.c +++ b/src/plugins/jobcomp/elasticsearch/jobcomp_elasticsearch.c @@ -879,6 +879,7 @@ extern int slurm_jobcomp_log_record(struct job_record *job_ptr) xrealloc(tmp, sizeof(char) * strlen(script_str) + 1 + 12); sprintf(tmp, ",\"script\":\"%s\"", script_str); xstrcat(buffer, tmp); + xfree(script_str); } if (job_ptr->assoc_ptr) { @@ -936,7 +937,6 @@ extern int slurm_jobcomp_log_record(struct job_record *job_ptr) } } - xfree(script_str); xfree(parent_accounts); xfree(buffer); xfree(tmp);