Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix mismatched alloc/free.
[simgrid.git] / src / smpi / colls / reduce / reduce-mvapich-knomial.cpp
index 90619c2..13454c2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2017. The SimGrid Team.
+/* Copyright (c) 2013-2019. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -92,7 +92,7 @@ static int MPIR_Reduce_knomial_trace(int root, int reduce_knomial_factor,
 
     /* Finally, fill up the src array */
     if(recv_iter > 0) {
-        knomial_reduce_src_array = static_cast<int*>(smpi_get_tmp_sendbuffer(sizeof(int)*recv_iter));
+      knomial_reduce_src_array = new int[recv_iter];
     }
 
     mask = orig_mask;
@@ -211,7 +211,7 @@ int Coll_reduce_mvapich2_knomial::reduce (
     }
 
     if(src_array != NULL) {
-        xbt_free(src_array);
+      delete[] src_array;
     }
 
     if(rank != root) {