Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect against NULL returned obj #2054

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/mca/rmaps/rank_file/rmaps_rank_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,12 @@ static int prte_rmaps_rf_lsf_convert_affinity_to_rankfile(char *affinity_file, c
for(i = 0; NULL != cpus[i]; ++i) {
// assume HNP has the same topology as other nodes
obj = hwloc_get_pu_obj_by_os_index(my_topo->topo, strtol(cpus[i], NULL, 10)) ;

if (NULL == obj) {
PMIX_ARGV_FREE_COMPAT(cpus);
fclose(fp);
close(fp_rank);
return PRTE_ERROR;
}
free(cpus[i]);
// 10 max number of digits in an int
cpus[i] = (char*)malloc(sizeof(char) * 10);
Expand Down
Loading