r18244 by jghali - more rigorous memory management in hyphenator

scribus-commit scribus-commit at lists.scribus.net
Sat Apr 13 17:04:45 UTC 2013


Author: jghali
Date: Sat Apr 13 17:04:44 2013
New Revision: 18244

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

Modified:
    branches/Version14x/Scribus/scribus/hyphenator.cpp

Modified: branches/Version14x/Scribus/scribus/hyphenator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18244&path=/branches/Version14x/Scribus/scribus/hyphenator.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/hyphenator.cpp (original)
+++ branches/Version14x/Scribus/scribus/hyphenator.cpp Sat Apr 13 17:04:44 2013
@@ -185,9 +185,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;
@@ -413,9 +413,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