From 10250a67ceadf2d784f69faee701a0af70f94458 Mon Sep 17 00:00:00 2001
From: Danny Auble <da@schedmd.com>
Date: Tue, 18 Jun 2013 14:46:37 -0700
Subject: [PATCH] step io - fix minor memory leak

---
 src/slurmd/slurmstepd/io.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/slurmd/slurmstepd/io.c b/src/slurmd/slurmstepd/io.c
index 0f77331befe..c963c07ed3b 100644
--- a/src/slurmd/slurmstepd/io.c
+++ b/src/slurmd/slurmstepd/io.c
@@ -1752,6 +1752,10 @@ _send_eof_msg(struct task_read_info *out)
 	msg->length = io_hdr_packed_size() + header.length;
 	msg->ref_count = 0; /* make certain it is initialized */
 
+	/* free the Buf packbuf, but not the memory to which it points */
+	packbuf->head = NULL;
+	free_buf(packbuf);
+
 	/* Add eof message to the msg_queue of all clients */
 	clients = list_iterator_create(out->job->clients);
 	while((eio = list_next(clients))) {
-- 
GitLab