mpi: remove NULL checks before frees

As Coverity points out, paths reaching these NULL checks will
have already dereferenced the pointers. So use the same condition
as for the allocation.
This commit is contained in:
Paul Floyd
2023-11-21 21:58:36 +01:00
parent 99d63f21c7
commit 89da13e731

View File

@@ -869,9 +869,15 @@ void walk_type ( void(*f)(void*,long), char* base, MPI_Datatype ty )
}
/* normal exit */
if (ints) free(ints);
if (addrs) free(addrs);
if (dtys) free(dtys);
if (n_ints > 0) {
free(ints);
}
if (n_addrs > 0) {
free(addrs);
}
if (n_dtys) {
free(dtys);
}
return;
unhandled: