From eee00ca63ec56182cb784ffd37d90d467140cde1 Mon Sep 17 00:00:00 2001 From: rpm-build Date: Tue, 23 May 2017 10:27:45 -0500 Subject: [PATCH] Fix: PE: Prevent use-after-free when creating bundle constraints Equivalent of upstream ff426526 by Andrew Beekhof for 7.4 context --- pengine/container.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pengine/container.c b/pengine/container.c index 5bde89d..7ec390e 100644 --- a/pengine/container.c +++ b/pengine/container.c @@ -155,7 +155,6 @@ container_internal_constraints(resource_t * rsc, pe_working_set_t * data_set) get_container_variant_data(container_data, rsc); for (GListPtr gIter = container_data->tuples; gIter != NULL; gIter = gIter->next) { - char *id = NULL; container_grouping_t *tuple = (container_grouping_t *)gIter->data; CRM_ASSERT(tuple); @@ -172,9 +171,7 @@ container_internal_constraints(resource_t * rsc, pe_working_set_t * data_set) new_rsc_order(tuple->docker, RSC_STOP, tuple->ip, RSC_STOP, pe_order_implies_first|pe_order_preserve, data_set); - id = crm_strdup_printf("%s-ip-with-docker-%d", rsc->id, tuple->offset); - rsc_colocation_new(id, NULL, INFINITY, tuple->ip, tuple->docker, NULL, NULL, data_set); - free(id); + rsc_colocation_new("ip-with-docker", NULL, INFINITY, tuple->ip, tuple->docker, NULL, NULL, data_set); } if(tuple->remote) { -- 1.8.3.1