diff options
author | David Sommerseth <davids@redhat.com> | 2009-04-30 19:18:17 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2009-04-30 19:18:17 +0200 |
commit | 89d2c50a648e3affd81ceb24e332bbd60de2b75d (patch) | |
tree | 88beff79de7677abb8efe16d2da758f06b4d4ed9 | |
parent | 268687f5b525ce4bdb1becd5a5207bfc2ced8340 (diff) | |
download | python-dmidecode-89d2c50a648e3affd81ceb24e332bbd60de2b75d.tar.gz python-dmidecode-89d2c50a648e3affd81ceb24e332bbd60de2b75d.tar.xz python-dmidecode-89d2c50a648e3affd81ceb24e332bbd60de2b75d.zip |
Fixed a bug causing segv
When calling dmidecode_get_xml(...) several times could cause a crash
due to the opt.dmiversion_n pointer being freed by a mistake when the
generated dmixml_n got freed later on in the function.
Also fixed an assertion typo
-rw-r--r-- | src/dmidecodemodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dmidecodemodule.c b/src/dmidecodemodule.c index 8c3a2b9..05689b0 100644 --- a/src/dmidecodemodule.c +++ b/src/dmidecodemodule.c @@ -158,11 +158,11 @@ xmlNode *dmidecode_get_xml(PyObject *self, const char *section) u8 *buf; xmlNode *dmixml_n = xmlNewNode(NULL, (xmlChar *) "dmidecode"); - assert( dmixml != NULL ); + assert( dmixml_n != NULL ); // Append DMI version info if( opt.dmiversion_n != NULL ) { - xmlAddChild(dmixml_n, opt.dmiversion_n); + xmlAddChild(dmixml_n, xmlCopyNode(opt.dmiversion_n, 1)); } const char *f = opt.dumpfile ? PyString_AsString(opt.dumpfile) : opt.devmem; |