r18245 by jghali - more rigorous memory management in hyphenator

scribus-commit scribus-commit at lists.scribus.net
Sat Apr 13 17:05:20 UTC 2013


Author: jghali
Date: Sat Apr 13 17:05:20 2013
New Revision: 18245

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18245
Log:
more rigorous memory management in hyphenator

Modified:
    trunk/Scribus/scribus/hyphenator.cpp

Modified: trunk/Scribus/scribus/hyphenator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18245&path=/trunk/Scribus/scribus/hyphenator.cpp
==============================================================================
--- trunk/Scribus/scribus/hyphenator.cpp (original)
+++ trunk/Scribus/scribus/hyphenator.cpp Sat Apr 13 17:05:20 2013
@@ -183,9 +183,9 @@
 				if (rep[i])
 					free(rep[i]);
 			free(rep);
-			free(pos);
-			free(cut);
-		}
+		}
+		if (pos) free(pos);
+		if (cut) free(cut);
 		buffer = NULL;
 		rep = NULL;
 		pos = NULL;
@@ -409,9 +409,9 @@
 					if (rep[i])
 						free(rep[i]);
 				free(rep);
-				free(pos);
-				free(cut);
 			}
+			if (pos) free(pos);
+			if (cut) free(cut);
 			buffer = NULL;
 			rep = NULL;
 			pos = NULL;




More information about the scribus-commit mailing list