Skip to content

Commit

Permalink
Merge pull request #1356 from manisandro/malloc_delete
Browse files Browse the repository at this point in the history
Fix malloc-ed memory freed by delete[]
  • Loading branch information
jef-n committed May 16, 2014
2 parents 2d749be + ea3be5c commit 89cdfb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/qgsmaptopixelgeometrysimplifier.cpp
Expand Up @@ -392,7 +392,7 @@ bool QgsMapToPixelSimplifier::simplifyGeometry( QgsGeometry* geometry, int simpl
// Simplify the geometry rewriting temporally its WKB-stream for saving calloc's.
if ( simplifyWkbGeometry( simplifyFlags, wkbType, wkb, wkbSize, wkb, targetWkbSize, envelope, tolerance ) )
{
unsigned char* targetWkb = ( unsigned char* )malloc( targetWkbSize );
unsigned char* targetWkb = new unsigned char[targetWkbSize];
memcpy( targetWkb, wkb, targetWkbSize );
geometry->fromWkb( targetWkb, targetWkbSize );
return true;
Expand Down

0 comments on commit 89cdfb9

Please sign in to comment.