소스 검색

Fix memleak when count is 0

Samuel Thibault 9 년 전
부모
커밋
256bc993b3
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      mpi/src/starpu_mpi_collective.c

+ 6 - 0
mpi/src/starpu_mpi_collective.c

@@ -140,6 +140,12 @@ int starpu_mpi_gather_detached(starpu_data_handle_t *data_handles, int count, in
 		}
 	}
 
+	if (!callback_arg->count)
+	{
+		free(callback_arg);
+		return 0;
+	}
+
 	for(x = 0; x < count ; x++)
 	{
 		if (data_handles[x])