diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2003-10-30 13:12:43 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2003-10-30 13:12:43 +0000 |
commit | bb3ba326e6ba5b661ca51aab53b17f519eda5924 (patch) | |
tree | 93a9b11d5a15eef2cfeb28e7a17627f013a869d0 /python | |
parent | e133dd8d13bbb32684b5fc7a2f329a71fcf944aa (diff) | |
download | android_external_libxml2-bb3ba326e6ba5b661ca51aab53b17f519eda5924.tar.gz android_external_libxml2-bb3ba326e6ba5b661ca51aab53b17f519eda5924.tar.bz2 android_external_libxml2-bb3ba326e6ba5b661ca51aab53b17f519eda5924.zip |
be more defensive in the xmlReader python bindings fixing bug #124044
* python/libxml.c: be more defensive in the xmlReader python bindings
fixing bug #124044
Daniel
Diffstat (limited to 'python')
-rw-r--r-- | python/libxml.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/python/libxml.c b/python/libxml.c index 2860bca8..2ae18560 100644 --- a/python/libxml.c +++ b/python/libxml.c @@ -1644,9 +1644,17 @@ libxml_xmlFreeTextReader(ATTRIBUTE_UNUSED PyObject *self, PyObject *args) { xmlTextReaderErrorFunc f; void *arg; + if (self == NULL) { + Py_INCREF(Py_None); + return(Py_None); + } if (!PyArg_ParseTuple(args, (char *)"O:xmlFreeTextReader", &pyobj_reader)) return(NULL); reader = (xmlTextReaderPtr) PyxmlTextReader_Get(pyobj_reader); + if (reader == NULL) { + Py_INCREF(Py_None); + return(Py_None); + } xmlTextReaderGetErrorHandler(reader,&f,&arg); if (arg != NULL) { |