r22499 by jghali - #15284: Wrong delete operator used on cpp array
scribus-commit
scribus-commit at lists.scribus.net
Mon Apr 30 09:35:35 UTC 2018
Author: jghali
Date: Mon Apr 30 09:35:35 2018
New Revision: 22499
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22499
Log:
#15284: Wrong delete operator used on cpp array
Modified:
trunk/Scribus/scribus/plugins/scripter/pythonize.cpp
Modified: trunk/Scribus/scribus/plugins/scripter/pythonize.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22499&path=/trunk/Scribus/scribus/plugins/scripter/pythonize.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/pythonize.cpp (original)
+++ trunk/Scribus/scribus/plugins/scripter/pythonize.cpp Mon Apr 30 09:35:35 2018
@@ -102,7 +102,6 @@
bool Pythonize::runString (char *str)
{
-
if (str == NULL || strlen (str) == 0) return false;
int res = PyRun_SimpleString (str);
@@ -116,13 +115,13 @@
char *fmtString = "import sys\nif not '%s' in sys.path:\n\tsys.path.append ('%s')\n"; //print sys.path\n";
int length = strlen (fmtString) + 2*strlen (newPath) + 1;
- char *line = new char [length];
+ char *line = new char [length];
if (!line) return false;
snprintf (line, length, fmtString, newPath, newPath);
int res = PyRun_SimpleString (line);
- delete line;
+ delete[] line;
return res == 0;
}
More information about the scribus-commit
mailing list