diff --git a/openmp/libomptarget/src/api.cpp b/openmp/libomptarget/src/api.cpp --- a/openmp/libomptarget/src/api.cpp +++ b/openmp/libomptarget/src/api.cpp @@ -174,6 +174,7 @@ rc = SrcDev.data_retrieve(buffer, srcAddr, length); if (rc == OFFLOAD_SUCCESS) rc = DstDev.data_submit(dstAddr, buffer, length); + free(buffer); } DP("omp_target_memcpy returns %d\n", rc);