diff --git a/src/plugins/mpi/pmix/pmixp_utils.c b/src/plugins/mpi/pmix/pmixp_utils.c
index f55f1af343f043fa9ba8d8095c134ed10d5bb801..89a0162f1de2919c24fb67015472469aba2d4f43 100644
--- a/src/plugins/mpi/pmix/pmixp_utils.c
+++ b/src/plugins/mpi/pmix/pmixp_utils.c
@@ -305,6 +305,10 @@ static int _send_to_stepds(hostlist_t hl, const char *addr, uint32_t len,
 		rc = SLURM_ERROR;
 	}
 
+	/* slurm_free_msg will try to free data which is on our stack,
+	 * so we need to NULL it out before it gets sent out.
+	 */
+	msg->data = NULL;
 	slurm_free_msg(msg);
 	xfree(nodelist);
 	xfree(req.address);