Commit e69479a5afb9c54604548c5f4c4c2b933513ae6d

Authored by Benjamin Renard
1 parent 0ec23281

Fix some memory leaks in VOTable reader

Showing 1 changed file with 12 additions and 0 deletions   Show diff stats
src/ParamGetImpl/LocalFileInterface/FileReaderVOTable.cc
@@ -83,7 +83,10 @@ void FileReaderVOTable::getVOTableInfo(void) { @@ -83,7 +83,10 @@ void FileReaderVOTable::getVOTableInfo(void) {
83 (const xmlChar*) "ID"); 83 (const xmlChar*) "ID");
84 84
85 if (groupId != NULL) 85 if (groupId != NULL)
  86 + {
86 crtGroupId = std::string((const char*) groupId); 87 crtGroupId = std::string((const char*) groupId);
  88 + xmlFree((xmlChar *) groupId);
  89 + }
87 else 90 else
88 crtGroupId = ""; 91 crtGroupId = "";
89 } 92 }
@@ -110,13 +113,22 @@ void FileReaderVOTable::getVOTableInfo(void) { @@ -110,13 +113,22 @@ void FileReaderVOTable::getVOTableInfo(void) {
110 paramInfo->setGroupId(crtGroupId); 113 paramInfo->setGroupId(crtGroupId);
111 114
112 if (paramName != NULL) 115 if (paramName != NULL)
  116 + {
113 paramInfo->setName((const char *) paramName); 117 paramInfo->setName((const char *) paramName);
  118 + xmlFree((xmlChar *) paramName);
  119 + }
114 120
115 if (paramSize != NULL) 121 if (paramSize != NULL)
  122 + {
116 paramInfo->setSize((const char *) paramSize); 123 paramInfo->setSize((const char *) paramSize);
  124 + xmlFree((xmlChar *) paramSize);
  125 + }
117 126
118 if (paramValue != NULL) 127 if (paramValue != NULL)
  128 + {
119 paramInfo->setValue((const char *) paramValue); 129 paramInfo->setValue((const char *) paramValue);
  130 + xmlFree((xmlChar *) paramValue);
  131 + }
120 132
121 LOG4CXX_INFO(gLogger, "PARAM : " << tagName << 133 LOG4CXX_INFO(gLogger, "PARAM : " << tagName <<
122 ", GROUP ID = " << paramInfo->getGroupId() << 134 ", GROUP ID = " << paramInfo->getGroupId() <<