r20736 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Wed Jan 27 22:50:19 UTC 2016


Author: jghali
Date: Wed Jan 27 22:50:18 2016
New Revision: 20736

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20736
Log:
fix resource leaks <coverity>

Modified:
    branches/Version14x/Scribus/scribus/plugins/gettext/odtim/stylereader.cpp

Modified: branches/Version14x/Scribus/scribus/plugins/gettext/odtim/stylereader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20736&path=/branches/Version14x/Scribus/scribus/plugins/gettext/odtim/stylereader.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/gettext/odtim/stylereader.cpp	(original)
+++ branches/Version14x/Scribus/scribus/plugins/gettext/odtim/stylereader.cpp	Wed Jan 27 22:50:18 2016
@@ -868,22 +868,17 @@
  
  void StyleReader::startElement(void*, const xmlChar * fullname, const xmlChar ** atts)
  {
- 	QString* name = new QString((const char*) fullname);
- 	name = new QString(name->toLower());
- 	QXmlAttributes* attrs = new QXmlAttributes();
- 	if (atts)
- 	{
- 		for(const xmlChar** cur = atts; cur && *cur; cur += 2)
- 			attrs->append(QString((char*)*cur), NULL, QString((char*)*cur), QString((char*)*(cur + 1)));
- 	}
- 	sreader->startElement(NULL, NULL, *name, *attrs);
+ 	QString name = QString((const char*) fullname).toLower();
+ 	QXmlAttributes attrs;
+ 	for(const xmlChar** cur = atts; cur && *cur; cur += 2)
+ 		attrs.append(QString((char*)*cur), NULL, QString((char*)*cur), QString((char*)*(cur + 1)));
+ 	sreader->startElement(NULL, NULL, name, attrs);
  }
  
  void StyleReader::endElement(void*, const xmlChar * name)
  {
- 	QString *nname = new QString((const char*) name);
- 	nname = new QString(nname->toLower());
- 	sreader->endElement(NULL, NULL, *nname);
+ 	QString nname = QString((const char*) name).toLower();
+ 	sreader->endElement(NULL, NULL, nname);
  }
 
 /*** ListLevel *****************************************************************************************/




More information about the scribus-commit mailing list