diff src/pst2ldif.cpp @ 41:183ae993b9ad

security fix for potential buffer overrun in lz decompress
author carl
date Tue, 02 Oct 2007 15:49:44 -0700
parents f5c024aa1dc5
children b2a7f2e0926a
line wrap: on
line diff
--- a/src/pst2ldif.cpp	Fri Aug 24 18:57:59 2007 -0700
+++ b/src/pst2ldif.cpp	Tue Oct 02 15:49:44 2007 -0700
@@ -79,6 +79,19 @@
 
 
 ////////////////////////////////////////////////
+// helper to free all the strings in a set
+//
+static void free_strings(string_set &s);
+static void free_strings(string_set &s)
+{
+	for (string_set::iterator i=s.begin(); i!=s.end(); i++) {
+		free(*i);
+	}
+	s.clear();
+}
+
+
+////////////////////////////////////////////////
 // helper to register a string in a string set
 //
 static char* register_string(string_set &s, char *name);
@@ -443,6 +456,7 @@
 	process(d_ptr->child);	// do the children of TOPF
 	pst_close(&pstfile);
 	DEBUG_RET();
+	free_strings(all_strings);
 	return 0;
 }