Skip to content
Permalink
Browse files
Fix malloc-ed memory freed by delete[]
  • Loading branch information
manisandro committed May 15, 2014
1 parent e880ee4 commit ea3be5c583184b101a4a0c0244176051db94fa2e
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/qgsmaptopixelgeometrysimplifier.cpp
@@ -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;

0 comments on commit ea3be5c

Please sign in to comment.