Package: antigravitaattori
Version: 0.0.3-2+b1
Severity: minor
Tag: patch

According to

http://qa.debian.org/daca/cppcheck/sid/antigrav_0.0.3-2.html

antigravitaattori

* Uses delete instead of delete[] in a few places.
* Forgets to free an allocated buffer in an error path.

Attached patch fixes these issues.

Attachment: pgpoLPPoDC1X5.pgp
Description: PGP signature

--- ./src/m3dtexture.cpp.orig	2006-08-04 21:38:31.000000000 +0200
+++ ./src/m3dtexture.cpp	2011-01-17 13:32:33.000000000 +0100
@@ -382,7 +382,7 @@
 
 	png_write_image(pngPtr, rowPointers);
 	png_write_end(pngPtr, pngInfoPtr);
-	delete rowPointers;
+	delete[] rowPointers;
 	png_destroy_write_struct(&pngPtr, &pngInfoPtr);
 	return 0;
 }
@@ -423,11 +423,11 @@
 	
 	if(savePNG(filename, data, width, height) != 0)
 	{
-		delete data;
+		delete[] data;
 		return -1;
 	}
 	
-	delete data;
+	delete[] data;
 	return 0;
 }
 
--- ./src/tinyxml/tinyxml.cpp.orig	2006-08-04 21:38:31.000000000 +0200
+++ ./src/tinyxml/tinyxml.cpp	2011-01-17 13:34:01.000000000 +0100
@@ -1085,6 +1085,7 @@
 
 	if ( fread( buf, length, 1, file ) != 1 ) {
 		SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
+		delete [] buf;
 		return false;
 	}
 
-- 
CYa,
  ⡍⠁⠗⠊⠕ | Debian Developer <URL:http://debian.org/>
  .''`. | Get my public key via finger mlang/k...@db.debian.org
 : :' : | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44
 `. `'
   `-      <URL:http://delysid.org/>  <URL:http://www.staff.tugraz.at/mlang/>

Reply via email to