浏览代码

port r14821 from 1.2: free descrs on returning -EINVAL

Samuel Thibault 10 年之前
父节点
当前提交
036ca2d85b
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 10 2
      mpi/src/starpu_mpi_task_insert.c

+ 10 - 2
mpi/src/starpu_mpi_task_insert.c

@@ -446,7 +446,11 @@ int _starpu_mpi_task_build_v(MPI_Comm comm, struct starpu_codelet *codelet, stru
 
 	/* Find out whether we are to execute the data because we own the data to be written to. */
 	ret = _starpu_mpi_task_decode_v(codelet, me, nb_nodes, &xrank, &do_execute, &descrs, &nb_data, varg_list);
-	if (ret < 0) return ret;
+	if (ret < 0)
+	{
+		free(descrs);
+		return ret;
+	}
 
 	/* Send and receive data as requested */
 	for(i=0 ; i<nb_data ; i++)
@@ -578,7 +582,11 @@ int starpu_mpi_task_post_build(MPI_Comm comm, struct starpu_codelet *codelet, ..
 	/* Find out whether we are to execute the data because we own the data to be written to. */
 	ret = _starpu_mpi_task_decode_v(codelet, me, nb_nodes, &xrank, &do_execute, &descrs, &nb_data, varg_list);
 	va_end(varg_list);
-	if (ret < 0) return ret;
+	if (ret < 0)
+	{
+		free(descrs);
+		return ret;
+	}
 
 	return _starpu_mpi_task_postbuild_v(comm, xrank, do_execute, descrs, nb_data);
 }