From 04c994ca8e0b9e84aff63ba90934b8aa5e194d56 Mon Sep 17 00:00:00 2001 From: Morris Jette <jette@schedmd.com> Date: Tue, 2 Jan 2018 16:38:53 -0700 Subject: [PATCH] Fix for possible memory leak Coverity CID 181852 --- src/plugins/burst_buffer/cray/burst_buffer_cray.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/burst_buffer/cray/burst_buffer_cray.c b/src/plugins/burst_buffer/cray/burst_buffer_cray.c index ccca55d8640..593d23f9e9c 100644 --- a/src/plugins/burst_buffer/cray/burst_buffer_cray.c +++ b/src/plugins/burst_buffer/cray/burst_buffer_cray.c @@ -2706,7 +2706,8 @@ static int _xlate_interactive(struct job_descriptor *job_desc) tok_len = strlen(access) + 7; memset(tok, ' ', tok_len); } - if ((tok = strstr(bb_copy, "access_mode="))) { + if ((access == NULL) && /* Not set above with "access=" */ + (tok = strstr(bb_copy, "access_mode="))) { access = xstrdup(tok + 12); sep = strchr(access, ','); if (sep) -- GitLab