diff options
author | Bastian Wissler | 2009-01-14 12:41:55 +0100 |
---|---|---|
committer | Bastian Wissler | 2009-01-14 12:41:55 +0100 |
commit | 6fc6a76bb7dafa624859d06e93d8c49d3b099af4 (patch) | |
tree | 953bfe6b15f68f43362587e74548a0eed2c900ed /vmchooser/addInfo.cxx | |
parent | vmchooser: (diff) | |
download | vmchooser-6fc6a76bb7dafa624859d06e93d8c49d3b099af4.tar.gz vmchooser-6fc6a76bb7dafa624859d06e93d8c49d3b099af4.tar.xz vmchooser-6fc6a76bb7dafa624859d06e93d8c49d3b099af4.zip |
vmchooser:
* Fixed bug in binary: Memory gets freed to early
git-svn-id: http://svn.openslx.org/svn/openslx/openslx-src-tools/vmchooser/trunk@2479 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'vmchooser/addInfo.cxx')
-rw-r--r-- | vmchooser/addInfo.cxx | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/vmchooser/addInfo.cxx b/vmchooser/addInfo.cxx index 1076a36..144e061 100644 --- a/vmchooser/addInfo.cxx +++ b/vmchooser/addInfo.cxx @@ -82,25 +82,27 @@ void addInfo(xmlNode* node) { else { cerr << "<hostname> node could not be created!" << endl; } - compnamenode = xmlNewNode(NULL, (const xmlChar*) "computername"); - if(compnamenode != NULL) { - xmlNewProp(compnamenode, (const xmlChar*) "param", (const xmlChar*) hostname); - // Add this node to the beginning of available children - // -> that is because bootpgm only looks in the first 500 chars - if(firstchild != NULL) { - xmlAddPrevSibling(firstchild, compnamenode); - } - xmlFreeNode(compnamenode); - } - else { - cerr << "<computername> node could not be created!" << endl; - } } else { // add param value to existant hostname-node xmlSetProp(hostnamenode, (const xmlChar*) "param", (xmlChar*) hostname); } - + + // We need to add computername-node as the first node + compnamenode = xmlNewNode(NULL, (const xmlChar*) "computername"); + if(compnamenode != NULL) { + xmlNewProp(compnamenode, (const xmlChar*) "param", (const xmlChar*) hostname); + // Add this node to the beginning of available children + // -> that is because bootpgm only looks in the first 500 chars + if(firstchild != NULL) { + xmlAddPrevSibling(firstchild, compnamenode); + } + //xmlFreeNode(compnamenode); + } + else { + cerr << "<computername> node could not be created!" << endl; + } + return; } |