Skip to content

Commit ceceeaf

Browse files
authored
Merge pull request #11744 from wenduwan/fix_double_free
opal/mca/ofi: Patch series to fix a crash due to double free on error path
2 parents 7d1bc78 + 002f5b4 commit ceceeaf

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

opal/mca/common/ofi/common_ofi.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -702,13 +702,14 @@ static int count_providers(struct fi_info *provider_list)
702702
return num_provider;
703703
}
704704

705-
/* Calculate the current process package rank.
706-
* @param (IN) process_info struct opal_process_info_t information
707-
* about the current process. used to get
708-
* num_local_peers, myprocid.rank, and
709-
* my_local_rank.
705+
/**
706+
* @brief the current process package rank.
707+
*
708+
* @param[in] process_info struct opal_process_info_t information
709+
* about the current process. used to get
710+
* num_local_peers, myprocid.rank.
710711
*
711-
* @param (OUT) uint32_t package rank or myprocid.rank
712+
* @return package rank or myprocid.rank
712713
*
713714
* If successful, returns PMIX_PACKAGE_RANK, or an
714715
* equivalent calculated package rank.
@@ -768,8 +769,9 @@ static uint32_t get_package_rank(opal_process_info_t *process_info)
768769
relative_locality = opal_hwloc_compute_relative_locality(process_info->locality,
769770
locality_string);
770771
free(locality_string);
772+
locality_string = NULL;
771773

772-
if ((uint16_t) pname.vpid == process_info->my_local_rank) {
774+
if ((uint16_t) pname.vpid == process_info->myprocid.rank) {
773775
return ranks_on_package;
774776
}
775777

0 commit comments

Comments
 (0)