Fix memory leak when accessing a const Node with a key that doesn't exist.

This commit is contained in:
Jesse Beder
2015-01-24 17:22:45 -06:00
parent a5e86cde59
commit 1025f76df1
8 changed files with 41 additions and 26 deletions

View File

@@ -26,10 +26,11 @@ class NullEventHandler : public YAML::EventHandler {
};
int main() {
std::stringstream stream("---{header: {id: 1");
YAML::Parser parser(stream);
// parser.PrintTokens(std::cout);
NullEventHandler handler;
parser.HandleNextDocument(handler);
const YAML::Node node;
std::string key = "doesnotexist";
for (;;) {
node[key];
}
return 0;
}