diff --git a/opal/mca/hwloc/base/hwloc_base_dt.c b/opal/mca/hwloc/base/hwloc_base_dt.c index 49b29ea81c..c3835b5b5c 100644 --- a/opal/mca/hwloc/base/hwloc_base_dt.c +++ b/opal/mca/hwloc/base/hwloc_base_dt.c @@ -77,12 +77,14 @@ int opal_hwloc_unpack(opal_buffer_t *buffer, void *dest, if (0 != hwloc_topology_set_flags(t, HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM)) { free(xmlbuffer); rc = OPAL_ERROR; + hwloc_topology_destroy(t); goto cleanup; } /* now load the topology */ if (0 != hwloc_topology_load(t)) { free(xmlbuffer); rc = OPAL_ERROR; + hwloc_topology_destroy(t); goto cleanup; } if (NULL != xmlbuffer) {