r20980 by craig -

scribus-commit scribus-commit at lists.scribus.net
Thu Feb 11 22:05:35 UTC 2016


Author: craig
Date: Thu Feb 11 22:05:34 2016
New Revision: 20980

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20980
Log:
coverity #1350056/1350057: unchecked return value, and lets close that file after all!

Modified:
    trunk/Scribus/scribus/pdflib_core.cpp

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20980&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp	(original)
+++ trunk/Scribus/scribus/pdflib_core.cpp	Thu Feb 11 22:05:34 2016
@@ -1712,17 +1712,23 @@
 static void dumpFont(QString name, QByteArray data)
 {
 	QFile file(name);
-	file.open(QIODevice::WriteOnly);
-	QDataStream out(&file);
-	out.writeRawData(data.data(), data.length());
+	if (file.open(QIODevice::WriteOnly))
+	{
+		QDataStream out(&file);
+		out.writeRawData(data.data(), data.length());
+		file.close();
+	}
 }
 
 static void dumpCFF(QString name, cff::CFF font)
 {
 	QFile file(name);
-	file.open(QIODevice::WriteOnly);
-	QDataStream out(&file);
-	font.dump(out);
+	if (file.open(QIODevice::WriteOnly))
+	{
+		QDataStream out(&file);
+		font.dump(out);
+		file.close();
+	}
 }
 
 




More information about the scribus-commit mailing list