Skip to content

Commit 4cb2518

Browse files
author
nicolas.with@st.ovgu.de
committed
fixed mismatched delete
1 parent 22d336f commit 4cb2518

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

example/mpi.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ int main(int argc, char const **argv)
2121
if (0 == rank)
2222
{
2323
char **rec_strs = new char *[size];
24-
for (int i = 0; i < size; i++)
25-
{
26-
rec_strs[i] = new char[SEND_LENGTH]();
27-
}
2824
rec_strs[0] = strdup(send_str.c_str());
2925

3026
for (int i = 1; i < size; ++i)
@@ -42,7 +38,7 @@ int main(int argc, char const **argv)
4238
for (int i = 0; i < size; ++i)
4339
{
4440
cout << rec_strs[i];
45-
delete[] rec_strs[i];
41+
free(rec_strs[i]);
4642
}
4743

4844
delete[] rec_strs;

0 commit comments

Comments
 (0)