]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed a big memory leak in DoDrawBitmap() (coverity checker CID 57)
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 7 Mar 2006 23:14:14 +0000 (23:14 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 7 Mar 2006 23:14:14 +0000 (23:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37876 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/dcpsg.cpp

index ed99c1cf253f8884d2605188a6b18ff52d334173..d9c6a9800a0cbf70efc6ff0b13522c866ed19771 100644 (file)
@@ -872,8 +872,8 @@ void wxPostScriptDC::DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y,
 
     unsigned char* data = image.GetData();
 
-    /* buffer = line = width*rgb(3)*hexa(2)+'\n'(1)+null(1) */
-    char* buffer = new char[ w*6+2 ];
+    // size of the buffer = width*rgb(3)*hexa(2)+'\n'
+    wxCharBuffer buffer(w*6 + 1);
     int firstDigit, secondDigit;
 
     //rows