Skip to content

Commit 31b9169

Browse files
committed
Fix my "delete buf" error and use "delete[] buf" as correct.
Thanks to Daniel for noticing.
1 parent 98dbb11 commit 31b9169

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mythtv/programs/mythutil/fileutils.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ static int CopyFile(const MythUtilCommandLineParser &cmdline)
3737
if (!srcRB)
3838
{
3939
LOG(VB_GENERAL, LOG_ERR, "ERROR, couldn't create Read RingBuffer");
40-
delete buf;
40+
delete[] buf;
4141
return GENERIC_EXIT_NOT_OK;
4242
}
4343

4444
if (!srcRB->IsOpen())
4545
{
4646
LOG(VB_GENERAL, LOG_ERR, "ERROR, srcRB is not open");
47-
delete buf;
47+
delete[] buf;
4848
delete srcRB;
4949
return GENERIC_EXIT_NOT_OK;
5050
}
@@ -53,15 +53,15 @@ static int CopyFile(const MythUtilCommandLineParser &cmdline)
5353
if (!destRB)
5454
{
5555
LOG(VB_GENERAL, LOG_ERR, "ERROR, couldn't create Write RingBuffer");
56-
delete buf;
56+
delete[] buf;
5757
delete srcRB;
5858
return GENERIC_EXIT_NOT_OK;
5959
}
6060

6161
if (!destRB->IsOpen())
6262
{
6363
LOG(VB_GENERAL, LOG_ERR, "ERROR, destRB is not open");
64-
delete buf;
64+
delete[] buf;
6565
delete srcRB;
6666
delete destRB;
6767
return GENERIC_EXIT_NOT_OK;
@@ -98,7 +98,7 @@ static int CopyFile(const MythUtilCommandLineParser &cmdline)
9898

9999
LOG(VB_GENERAL, LOG_INFO, "Waiting for write buffer to flush");
100100

101-
delete buf;
101+
delete[] buf;
102102
delete srcRB;
103103
delete destRB;
104104

0 commit comments

Comments
 (0)