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 | |
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
-rw-r--r-- | vmchooser/Makefile | 2 | ||||
-rw-r--r-- | vmchooser/addInfo.cxx | 30 |
2 files changed, 17 insertions, 15 deletions
diff --git a/vmchooser/Makefile b/vmchooser/Makefile index 6bc1390..5e32081 100644 --- a/vmchooser/Makefile +++ b/vmchooser/Makefile @@ -8,7 +8,7 @@ CC = g++ DEBUG_CCFLAGS = -O0 -Wall -I/usr/include -I../fltk-2/include/ -I. `xml2-config --cflags` -ggdb #-ggdb #-Werror CCFLAGS = -O2 -Wall -I/usr/include -I../fltk-2/include/ -I. `xml2-config --cflags` LDFLAGS = -L../fltk-2/lib/ -L/usr/lib -LIBS = -lpng ../fltk-2/lib/libfltk2_images.a -ljpeg -lz -lXi -lXinerama -lpthread -lm -lXext -lsupc++ -lXrender -lfontconfig -lxml2 -lXft -lXdmcp -lXau -ldl -lz -lfreetype -lX11 ../fltk-2/lib/libfltk2.a /usr/lib/libboost_regex.a +LIBS = -lpng ../fltk-2/lib/libfltk2_images.a -ljpeg -lz -lXi -lXinerama -lpthread -lm -lXext -lsupc++ -lXrender -lfontconfig -lxml2 -lXft -lXdmcp -lXau -ldl -lz -lfreetype -lX11 ../fltk-2/lib/libfltk2.a /usr/lib/libboost_regex-s.a .PHONY: all clean distclean all:: ${TARGET} 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; } |