From 1ccdf74b1e537c4bd747c079530a5d9ea904e138 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Mon, 4 May 2009 10:39:02 +0200 Subject: Improved error handling when parsing mapping XML --- src/dmidecodemodule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/dmidecodemodule.c') diff --git a/src/dmidecodemodule.c b/src/dmidecodemodule.c index fc3a7ed..14ff148 100644 --- a/src/dmidecodemodule.c +++ b/src/dmidecodemodule.c @@ -256,7 +256,9 @@ static PyObject *dmidecode_get(PyObject *self, const char *section) } mapping = dmiMAP_ParseMappingXML(opt.mappingxml, section); - assert( mapping != NULL ); + if( mapping == NULL ) { + return NULL; + } // Generate Python dict out of XML node pydata = pythonizeXMLnode(mapping, dmixml_n); -- cgit