@@ -164,7 +164,7 @@ void QgsMssqlGeometryParser::CopyBytes( void* src, int len )
164
164
QgsDebugMsg ( " CopyBytes wkb buffer realloc" );
165
165
unsigned char * pszWkbTmp = new unsigned char [nWkbLen + len + 100 ];
166
166
memcpy ( pszWkbTmp, pszWkb, nWkbLen );
167
- delete pszWkb;
167
+ delete[] pszWkb;
168
168
pszWkb = pszWkbTmp;
169
169
nWkbMaxLen = nWkbLen + len + 100 ;
170
170
}
@@ -499,7 +499,7 @@ unsigned char* QgsMssqlGeometryParser::ParseSqlGeometry( unsigned char* pszInput
499
499
500
500
if ( nLen < 6 + nPointSize )
501
501
{
502
- free ( pszWkb ) ;
502
+ delete [] pszWkb ;
503
503
QgsDebugMsg ( " ParseSqlGeometry not enough data" );
504
504
DumpMemoryToLog ( " Not enough data" , pszInput, nLen );
505
505
return NULL ;
@@ -515,7 +515,7 @@ unsigned char* QgsMssqlGeometryParser::ParseSqlGeometry( unsigned char* pszInput
515
515
516
516
if ( nLen < 6 + 2 * nPointSize )
517
517
{
518
- free ( pszWkb ) ;
518
+ delete [] pszWkb ;
519
519
QgsDebugMsg ( " ParseSqlGeometry not enough data" );
520
520
DumpMemoryToLog ( " Not enough data" , pszInput, nLen );
521
521
return NULL ;
@@ -544,7 +544,7 @@ unsigned char* QgsMssqlGeometryParser::ParseSqlGeometry( unsigned char* pszInput
544
544
545
545
if ( nNumPoints <= 0 )
546
546
{
547
- free ( pszWkb ) ;
547
+ delete [] pszWkb ;
548
548
return NULL ;
549
549
}
550
550
@@ -556,7 +556,7 @@ unsigned char* QgsMssqlGeometryParser::ParseSqlGeometry( unsigned char* pszInput
556
556
557
557
if ( nLen < nFigurePos )
558
558
{
559
- free ( pszWkb ) ;
559
+ delete [] pszWkb ;
560
560
QgsDebugMsg ( " ParseSqlGeometry not enough data" );
561
561
DumpMemoryToLog ( " Not enough data" , pszInput, nLen );
562
562
return NULL ;
@@ -566,7 +566,7 @@ unsigned char* QgsMssqlGeometryParser::ParseSqlGeometry( unsigned char* pszInput
566
566
567
567
if ( nNumFigures <= 0 )
568
568
{
569
- free ( pszWkb ) ;
569
+ delete [] pszWkb ;
570
570
return NULL ;
571
571
}
572
572
@@ -575,7 +575,7 @@ unsigned char* QgsMssqlGeometryParser::ParseSqlGeometry( unsigned char* pszInput
575
575
576
576
if ( nLen < nShapePos )
577
577
{
578
- free ( pszWkb ) ;
578
+ delete [] pszWkb ;
579
579
QgsDebugMsg ( " ParseSqlGeometry not enough data" );
580
580
DumpMemoryToLog ( " Not enough data" , pszInput, nLen );
581
581
return NULL ;
@@ -585,22 +585,22 @@ unsigned char* QgsMssqlGeometryParser::ParseSqlGeometry( unsigned char* pszInput
585
585
586
586
if ( nLen < nShapePos + 9 * nNumShapes )
587
587
{
588
- free ( pszWkb ) ;
588
+ delete [] pszWkb ;
589
589
QgsDebugMsg ( " ParseSqlGeometry not enough data" );
590
590
DumpMemoryToLog ( " Not enough data" , pszInput, nLen );
591
591
return NULL ;
592
592
}
593
593
594
594
if ( nNumShapes <= 0 )
595
595
{
596
- free ( pszWkb ) ;
596
+ delete [] pszWkb ;
597
597
return NULL ;
598
598
}
599
599
600
600
// pick up the root shape
601
601
if ( ParentOffset ( 0 ) != 0xFFFFFFFF )
602
602
{
603
- free ( pszWkb ) ;
603
+ delete [] pszWkb ;
604
604
QgsDebugMsg ( " ParseSqlGeometry corrupt data" );
605
605
DumpMemoryToLog ( " Not enough data" , pszInput, nLen );
606
606
return NULL ;
@@ -631,7 +631,7 @@ unsigned char* QgsMssqlGeometryParser::ParseSqlGeometry( unsigned char* pszInput
631
631
// ReadGeometryCollection(0);
632
632
// break;
633
633
default :
634
- free ( pszWkb ) ;
634
+ delete [] pszWkb ;
635
635
QgsDebugMsg ( " ParseSqlGeometry unsupported geometry type" );
636
636
DumpMemoryToLog ( " Unsupported geometry type" , pszInput, nLen );
637
637
return NULL ;
0 commit comments