diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2015-12-15 18:21:06 +0100 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2015-12-15 18:21:06 +0100 |
commit | 68cee16b2d7f8e5d9f9c4699822542664bbf492f (patch) | |
tree | 3c713f18578b86ccf4fb914e56123ca0e8c63ac0 | |
parent | 88e98e505666d953aa2ccee1633107226bf98e07 (diff) |
Free and return in one place
Change-Id: Ib0a38c4f9103b25f174a7b34830bff307fa6c9be
-rw-r--r-- | src/lib/VSDXParser.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/lib/VSDXParser.cpp b/src/lib/VSDXParser.cpp index 1460f88..b8ef91b 100644 --- a/src/lib/VSDXParser.cpp +++ b/src/lib/VSDXParser.cpp @@ -581,30 +581,25 @@ int libvisio::VSDXParser::getElementToken(xmlTextReaderPtr reader) else if (!strncmp((char *)stringValue, "Alignment", 9)) tokenId = XML_ALIGNMENT; } - xmlFree(stringValue); } - return tokenId; + break; case XML_ROW: stringValue = xmlTextReaderGetAttribute(reader, BAD_CAST("N")); if (!stringValue) stringValue = xmlTextReaderGetAttribute(reader, BAD_CAST("T")); if (stringValue) - { tokenId = VSDXMLTokenMap::getTokenId(stringValue); - xmlFree(stringValue); - } - return tokenId; + break; case XML_SECTION: stringValue = xmlTextReaderGetAttribute(reader, BAD_CAST("N")); if (stringValue) - { tokenId = VSDXMLTokenMap::getTokenId(stringValue); - xmlFree(stringValue); - } - return tokenId; + break; default: break; } + if (stringValue) + xmlFree(stringValue); return tokenId; } |