diff options
| author | Jonathan Robie <jonathan@apache.org> | 2010-09-16 14:52:37 +0000 |
|---|---|---|
| committer | Jonathan Robie <jonathan@apache.org> | 2010-09-16 14:52:37 +0000 |
| commit | fe7795e99546106e4d99d085e0d6450040fb00f9 (patch) | |
| tree | a5b1321053b4b2bb92023de1a78eb3fdb473f4ca /cpp/src/qpid/messaging/AddressParser.cpp | |
| parent | e8f203ea1d16613719d686dd63d963d91842ca1c (diff) | |
| download | qpid-python-fe7795e99546106e4d99d085e0d6450040fb00f9.tar.gz | |
Fixes parsing problem with empty lists ('[]') in addresses, which previously raised an exception and leaked the memory associated with the AddressImpl.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@997771 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/messaging/AddressParser.cpp')
| -rw-r--r-- | cpp/src/qpid/messaging/AddressParser.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cpp/src/qpid/messaging/AddressParser.cpp b/cpp/src/qpid/messaging/AddressParser.cpp index b6d5f764cf..c34c9c0f56 100644 --- a/cpp/src/qpid/messaging/AddressParser.cpp +++ b/cpp/src/qpid/messaging/AddressParser.cpp @@ -94,7 +94,7 @@ bool AddressParser::readList(Variant& value) void AddressParser::readListItems(Variant::List& list) { Variant item; - while (readValue(item)) { + while (readValueIfExists(item)) { list.push_back(item); if (!readChar(',')) break; } @@ -139,8 +139,13 @@ bool AddressParser::readKey(std::string& key) bool AddressParser::readValue(Variant& value) { + return readValueIfExists(value) || error("Expected value"); +} + +bool AddressParser::readValueIfExists(Variant& value) +{ return readSimpleValue(value) || readQuotedValue(value) || - readMap(value) || readList(value) || error("Expected value"); + readMap(value) || readList(value); } bool AddressParser::readString(std::string& value, char delimiter) |
