commit a1096a8d6c5ccaae82534c669ccae94b976a53a4 Author: Julien Nabet Date: Sun Jun 9 00:29:02 2013 +0200 cppcheck: Fix Mismatching allocation and deallocation diff --git a/poppler/UTF.cc b/poppler/UTF.cc index 42c7836..46007b7 100644 --- a/poppler/UTF.cc +++ b/poppler/UTF.cc @@ -101,7 +101,7 @@ int TextStringToUCS4(GooString *textStr, Unicode **ucs4) utf16[i] = (s[2 + i*2] & 0xff) << 8 | (s[3 + i*2] & 0xff); } len = UTF16toUCS4(utf16, len, &u); - delete utf16; + delete[] utf16; } else { u = NULL; } diff --git a/qt4/src/poppler-private.h b/qt4/src/poppler-private.h index 5759a4e..b3460f7 100644 --- a/qt4/src/poppler-private.h +++ b/qt4/src/poppler-private.h @@ -87,7 +87,7 @@ namespace Poppler { wchar_t *fileName = new WCHAR[filePath.length()]; int length = filePath.toWCharArray(fileName); doc = new PDFDoc(fileName, length, ownerPassword, userPassword); - delete fileName; + delete[] fileName; #else GooString *fileName = new GooString(QFile::encodeName(filePath)); doc = new PDFDoc(fileName, ownerPassword, userPassword);