Commit e69479a5afb9c54604548c5f4c4c2b933513ae6d
1 parent
0ec23281
Exists in
master
and in
100 other branches
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 | 83 | (const xmlChar*) "ID"); |
84 | 84 | |
85 | 85 | if (groupId != NULL) |
86 | + { | |
86 | 87 | crtGroupId = std::string((const char*) groupId); |
88 | + xmlFree((xmlChar *) groupId); | |
89 | + } | |
87 | 90 | else |
88 | 91 | crtGroupId = ""; |
89 | 92 | } |
... | ... | @@ -110,13 +113,22 @@ void FileReaderVOTable::getVOTableInfo(void) { |
110 | 113 | paramInfo->setGroupId(crtGroupId); |
111 | 114 | |
112 | 115 | if (paramName != NULL) |
116 | + { | |
113 | 117 | paramInfo->setName((const char *) paramName); |
118 | + xmlFree((xmlChar *) paramName); | |
119 | + } | |
114 | 120 | |
115 | 121 | if (paramSize != NULL) |
122 | + { | |
116 | 123 | paramInfo->setSize((const char *) paramSize); |
124 | + xmlFree((xmlChar *) paramSize); | |
125 | + } | |
117 | 126 | |
118 | 127 | if (paramValue != NULL) |
128 | + { | |
119 | 129 | paramInfo->setValue((const char *) paramValue); |
130 | + xmlFree((xmlChar *) paramValue); | |
131 | + } | |
120 | 132 | |
121 | 133 | LOG4CXX_INFO(gLogger, "PARAM : " << tagName << |
122 | 134 | ", GROUP ID = " << paramInfo->getGroupId() << | ... | ... |