diff --git a/src/common/read_config.c b/src/common/read_config.c
index 955d16c860218a3ea319c3da7f026030e89b2abf..f45bae11ef71e8f87fe209bcf17fc915436617ec 100644
--- a/src/common/read_config.c
+++ b/src/common/read_config.c
@@ -476,9 +476,11 @@ static int parse_partitionname(void **dest, slurm_parser_enum_t type,
 			else {
 				error("Bad value \"%s\" for Shared", tmp);
 				destroy_partitionname(p);
+				xfree(tmp);
 				return -1;
 			}
 		}
+		xfree(tmp);
 
 		if (!s_p_get_boolean(&p->state_up_flag, "State", tbl)
 		    && !s_p_get_boolean(&p->state_up_flag, "State", dflt))