summaryrefslogtreecommitdiffstats
path: root/src/dmidecodemodule.c
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2009-05-04 10:39:02 +0200
committerDavid Sommerseth <davids@redhat.com>2009-05-04 10:39:02 +0200
commit1ccdf74b1e537c4bd747c079530a5d9ea904e138 (patch)
tree49eebffe831a35fd20b6547f8172f255e900093b /src/dmidecodemodule.c
parentaad6b79d7363ea4fa1c1ce67a39848b13bdd19f4 (diff)
downloadpython-dmidecode-1ccdf74b1e537c4bd747c079530a5d9ea904e138.tar.gz
python-dmidecode-1ccdf74b1e537c4bd747c079530a5d9ea904e138.tar.xz
python-dmidecode-1ccdf74b1e537c4bd747c079530a5d9ea904e138.zip
Improved error handling when parsing mapping XML
Diffstat (limited to 'src/dmidecodemodule.c')
-rw-r--r--src/dmidecodemodule.c4
1 files changed, 3 insertions, 1 deletions
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);