mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-08 12:21:17 +00:00
Fix memory leak when accessing a const Node with a key that doesn't exist.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user