Fixes a double-free in the error path of ncclCommInitAll.

Fixes https://github.com/NVIDIA/nccl/issues/726


[ROCm/rccl commit: 2401f4a918]
Этот коммит содержится в:
John Bachan
2022-10-03 17:02:15 -07:00
родитель 8761a6c2fc
Коммит c9cd7243ed
+3 -4
Просмотреть файл
@@ -1215,6 +1215,7 @@ ncclResult_t ncclCommInitAll(ncclComm_t* comms, int ndev, const int* devlist) {
gpuFlags[devlist[i]] = 1;
}
free(gpuFlags);
gpuFlags = nullptr;
}
ncclUniqueId uniqueId;
@@ -1226,11 +1227,9 @@ ncclResult_t ncclCommInitAll(ncclComm_t* comms, int ndev, const int* devlist) {
}
NCCLCHECKGOTO(ncclGroupEnd(), ret, fail);
exit:
return ret;
fail:
if (gpuFlags) free(gpuFlags);
goto exit;
free(gpuFlags);
return ret;
}
ncclResult_t ncclCommSetAsyncError(ncclComm_t comm, ncclResult_t nextState) {