Opened 8 years ago

Closed 8 years ago

#12835 closed bug (fixed)

[Patch] pcl6: Fix mismatching allocation and deallocation

Reported by: mt Owned by: phoudoin
Priority: normal Milestone: Unscheduled
Component: Drivers/Printers Version: R1/Development
Keywords: pcl6 Cc:
Blocked By: Blocking:
Platform: All

Description

fSeedRow and fBuffer are allocated by new[] [1][2], but deallocated by delete [3][4]. [1] http://cgit.haiku-os.org/haiku/tree/src/add-ons/print/drivers/pcl6/DeltaRowCompression.cpp#n19 [2] http://cgit.haiku-os.org/haiku/tree/src/add-ons/print/drivers/pcl6/PCL6Writer.cpp#n20 [3] http://cgit.haiku-os.org/haiku/tree/src/add-ons/print/drivers/pcl6/DeltaRowCompression.cpp#n29 [4] http://cgit.haiku-os.org/haiku/tree/src/add-ons/print/drivers/pcl6/PCL6Writer.cpp#n29

/home/haiku/haiku/haiku/src/add-ons/print/drivers/pcl6/DeltaRowCompression.cpp:29:2: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
        delete fSeedRow;
        ^
              []
/home/haiku/haiku/haiku/src/add-ons/print/drivers/pcl6/DeltaRowCompression.cpp:19:11: note: allocated with 'new[]' here
        fSeedRow(new uchar[rowSize]),
                 ^
/home/haiku/haiku/haiku/src/add-ons/print/drivers/pcl6/PCL6Writer.cpp:29:2: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
        delete fBuffer;
        ^
              []
/home/haiku/haiku/haiku/src/add-ons/print/drivers/pcl6/PCL6Writer.cpp:20:10: note: allocated with 'new[]' here
        fBuffer(new uint8[bufferSize]),
                ^

Attachments (1)

0020-pcl6-Fix-mismatching-allocation-and-deallocation.patch (1.3 KB ) - added by mt 8 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 by mt, 8 years ago

patch: 01

comment:2 by pulkomandy, 8 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev50402.

Note: See TracTickets for help on using tickets.