From bb8502c0ef2af706fbdff69119e994e40da64a88 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Wed, 30 Mar 2005 07:40:35 +0000 Subject: [PATCH] applied patch from Brent Hendricks to avoid leak in python bindings when * python/generator.py python/libxml.c: applied patch from Brent Hendricks to avoid leak in python bindings when using schemas error handlers. Daniel --- ChangeLog | 6 ++++++ python/generator.py | 3 +++ python/libxml.c | 7 +++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f364a96c..0be29c81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Mar 30 09:39:27 CEST 2005 Daniel Veillard + + * python/generator.py python/libxml.c: applied patch from Brent + Hendricks to avoid leak in python bindings when using schemas + error handlers. + Tue Mar 29 22:29:28 CEST 2005 Daniel Veillard * HTMLtree.c: fixing bug 168196, must be URI escaped too diff --git a/python/generator.py b/python/generator.py index 8add0a93..0856d76d 100755 --- a/python/generator.py +++ b/python/generator.py @@ -346,6 +346,9 @@ def skip_function(name): return 1 if name == "xmlFreeValidCtxt": return 1 + if name == "xmlSchemaFreeValidCtxt": + return 1 + # # Those are skipped because the Const version is used of the bindings # instead. diff --git a/python/libxml.c b/python/libxml.c index b5209949..1b19f2bb 100644 --- a/python/libxml.c +++ b/python/libxml.c @@ -1859,7 +1859,7 @@ libxml_xmlSetValidErrors(ATTRIBUTE_UNUSED PyObject * self, PyObject * args) } -PyObject * +static PyObject * libxml_xmlFreeValidCtxt(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { xmlValidCtxtPtr cur; xmlValidCtxtPyCtxtPtr pyCtxt; @@ -3289,8 +3289,7 @@ libxml_xmlSchemaSetValidErrors(ATTRIBUTE_UNUSED PyObject * self, PyObject * args return(py_retval); } -#if 0 -PyObject * +static PyObject * libxml_xmlSchemaFreeValidCtxt(ATTRIBUTE_UNUSED PyObject * self, PyObject * args) { xmlSchemaValidCtxtPtr ctxt; @@ -3316,7 +3315,6 @@ libxml_xmlSchemaFreeValidCtxt(ATTRIBUTE_UNUSED PyObject * self, PyObject * args) Py_INCREF(Py_None); return(Py_None); } -#endif #endif @@ -3668,6 +3666,7 @@ static PyMethodDef libxmlMethods[] = { {(char *)"xmlRelaxNGSetValidErrors", libxml_xmlRelaxNGSetValidErrors, METH_VARARGS, NULL}, {(char *)"xmlRelaxNGFreeValidCtxt", libxml_xmlRelaxNGFreeValidCtxt, METH_VARARGS, NULL}, {(char *)"xmlSchemaSetValidErrors", libxml_xmlSchemaSetValidErrors, METH_VARARGS, NULL}, + {(char *)"xmlSchemaFreeValidCtxt", libxml_xmlSchemaFreeValidCtxt, METH_VARARGS, NULL}, #endif #ifdef LIBXML_C14N_ENABLED #ifdef LIBXML_OUTPUT_ENABLED