Explorar o código

Fix memleak when count is 0

Samuel Thibault %!s(int64=10) %!d(string=hai) anos
pai
achega
ceab8c183e
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      mpi/src/starpu_mpi_collective.c

+ 6 - 0
mpi/src/starpu_mpi_collective.c

@@ -76,6 +76,12 @@ int starpu_mpi_scatter_detached(starpu_data_handle_t *data_handles, int count, i
 				}
 			}
 		}
+
+		if (!callback_arg->count)
+		{
+			free(callback_arg);
+			return 0;
+		}
 	}
 
 	for(x = 0; x < count ; x++)