mirror of
git://sourceware.org/git/valgrind.git
synced 2026-01-12 00:19:31 +08:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user