summaryrefslogtreecommitdiff
blob: 2c612dc5e80fb7c0c4be6428593d3b9b0273cca9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
--- src/fwbuilder/XMLTools.cc	2003-11-12 06:04:04.000000000 +0000
+++ src/fwbuilder/XMLTools.cc	2004-01-13 08:16:32.790141976 +0000
@@ -6,7 +6,7 @@
 
   Author:  Vadim Kurland     vadim@vk.crocodile.org
 
-  $Id: libfwbuilder-1.0.2-libxml2.patch,v 1.1 2004/01/13 08:31:23 aliz Exp $
+  $Id: libfwbuilder-1.0.2-libxml2.patch,v 1.1 2004/01/13 08:31:23 aliz Exp $
 
 
   This program is free software which we release under the GNU General Public
@@ -374,13 +374,24 @@
 
     try
     {
+/*
+ * This broke with libxml 2.6.4. Tests seem to rule out bug inside
+ * libxml2 (used their example program "tree2.c" and added similar
+ * fragment for validation, it worked), so it must be something in our
+ * code. I can't seem to find the problem though. 
+ *
+ * We recreate the tree from the objects in the memory, so doing
+ * validation here is mostly a double check. It should be relatively
+ * safe to just skip validation until I figure out what's wrong with
+ * it.
+
         xmlValidCtxt vctxt;
         vctxt.userData = &errors;
         vctxt.error    = xslt_error_handler;
         vctxt.warning  = xslt_error_handler;
         if(xmlValidateDocument(&vctxt, doc)!=1)
             throw FWException(string("DTD validation stage 2 failed with following errors:\n")+errors);
-
+*/
         xmlSetGenericErrorFunc (NULL, NULL);
         g_mutex_unlock(xml_parser_mutex);    
 
diff -ru /var/tmp/portage/libfwbuilder-1.0.2/work/libfwbuilder-1.0.2/src/fwbuilder/XMLTools.hh ./src/fwbuilder/XMLTools.hh
--- src/fwbuilder/XMLTools.hh	2003-11-12 06:04:04.000000000 +0000
+++ src/fwbuilder/XMLTools.hh	2004-01-13 08:16:32.794141003 +0000
@@ -6,7 +6,7 @@
 
   Author:  Vadim Kurland     vadim@vk.crocodile.org
 
-  $Id: libfwbuilder-1.0.2-libxml2.patch,v 1.1 2004/01/13 08:31:23 aliz Exp $
+  $Id: libfwbuilder-1.0.2-libxml2.patch,v 1.1 2004/01/13 08:31:23 aliz Exp $
 
 
   This program is free software which we release under the GNU General Public
@@ -51,7 +51,22 @@
 #define FROMXMLCAST(x) ((const char *)x)
 #define STRTOXMLCAST(x) ((xmlChar *)x.c_str())
 #define TOXMLCAST(x) ((xmlChar *)x)
-#define FREEXMLBUFF(x) (free((void*)(x)))
+
+/**
+ * this macro is used to free data chunks allocated by libxml2.
+ * Funtion xmlGetProp and the likes return data in the blocks of memory
+ * that they allocate internally using malloc. To prevent memory leaks
+ * these blocks need to be freed. Memory must be freed using xmlFree function.
+ *
+ * The problem though is that in the win32 version of libxml that I use,
+ * declarations of all memory handling functions are commented out. This is so
+ * as of Dec2003, ver. 2.6.3, see in include/libxml/xmlmemory.h
+ */
+#ifdef xmlFree
+#  define FREEXMLBUFF(x) (xmlFree((void*)(x)))
+#else
+#  define FREEXMLBUFF(x)   ;
+#endif
 
 class XMLTools
 {