From d93ce2cd9f942aa7ee5b02be45bbbe868f1307e5 Mon Sep 17 00:00:00 2001 From: Danny Auble <da@schedmd.com> Date: Tue, 10 Oct 2017 07:29:10 -0600 Subject: [PATCH] Revert "Fix segfault in slurm_cred_unpack on error." This reverts commit 48a713085690a94fb0749dc4f3138b6d9a65ea07. --- src/common/slurm_cred.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/common/slurm_cred.c b/src/common/slurm_cred.c index 11a97a16cea..b3c075ed996 100644 --- a/src/common/slurm_cred.c +++ b/src/common/slurm_cred.c @@ -1292,7 +1292,6 @@ slurm_cred_unpack(Buf buffer, uint16_t protocol_version) { uint32_t cred_uid, len; slurm_cred_t *cred = NULL; - char *bit_fmt_str = NULL; char **sigp; uint32_t cluster_flags = slurmdb_setup_cluster_flags(); @@ -1383,19 +1382,20 @@ slurm_cred_unpack(Buf buffer, uint16_t protocol_version) if (!(cluster_flags & CLUSTER_FLAG_BG)) { uint32_t tot_core_cnt; + char *bit_fmt = NULL; safe_unpack32(&tot_core_cnt, buffer); - safe_unpackstr_xmalloc(&bit_fmt_str, &len, buffer); + safe_unpackstr_xmalloc(&bit_fmt, &len, buffer); cred->job_core_bitmap = bit_alloc((bitoff_t) tot_core_cnt); - if (bit_unfmt(cred->job_core_bitmap, bit_fmt_str)) + if (bit_unfmt(cred->job_core_bitmap, bit_fmt)) goto unpack_error; - xfree(bit_fmt_str); - safe_unpackstr_xmalloc(&bit_fmt_str, &len, buffer); + xfree(bit_fmt); + safe_unpackstr_xmalloc(&bit_fmt, &len, buffer); cred->step_core_bitmap = bit_alloc((bitoff_t) tot_core_cnt); - if (bit_unfmt(cred->step_core_bitmap, bit_fmt_str)) + if (bit_unfmt(cred->step_core_bitmap, bit_fmt)) goto unpack_error; - xfree(bit_fmt_str); + xfree(bit_fmt); safe_unpack16(&cred->core_array_size, buffer); if (cred->core_array_size) { safe_unpack16_array(&cred->cores_per_socket, @@ -1432,7 +1432,7 @@ slurm_cred_unpack(Buf buffer, uint16_t protocol_version) return cred; unpack_error: - xfree(bit_fmt_str); + xfree(bit_fmt); slurm_mutex_unlock(&cred->mutex); slurm_cred_destroy(cred); return NULL; -- GitLab