Skip to content

Commit

Permalink
YAwn: Fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
sanssecours committed Feb 9, 2019
1 parent e84e16e commit e8c4046
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion doc/news/_preparation_next_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ and be assured that you can safely set a path value to the key. A more detailed

- The plugin now handles comments at the end of a file properly. *(René Schwaiger)*
- We improved the syntax error messages of the plugin. *(René Schwaiger)*
- We fixed a memory leak that occurred, if a YAML file contained syntax errors. *(René Schwaiger)*

### YAy PEG

Expand All @@ -142,7 +143,7 @@ The new plugin [YAy PEG](https://www.libelektra.org/plugins/yaypeg) parses a sub
- [`resolver`](https://www.libelektra.org/plugins/resolver)

reported on FreeBSD. *(René Schwaiger)*
- The [`resolver` plugin](/src/plugins/resolver) and its tests now better support `KDB_DB_SYSTEM` and `KDB_DB_SPEC` paths
- The [`resolver` plugin](/src/plugins/resolver) and its tests now better support `KDB_DB_SYSTEM` and `KDB_DB_SPEC` paths
using `~` to refer to a home directory. *(Klemens Böswirth)*
- If `KDB_DB_SYSTEM` is set to a relative path, it is now treated as relative to `CMAKE_INSTALL_PREFIX`. This ensures that
`KDB_DB_SYSTEM` actually points to the same location no matter the current working directory. *(Klemens Böswirth)*
Expand Down
6 changes: 5 additions & 1 deletion src/plugins/yawn/convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ int addToKeySet (CppKeySet & keySet, CppKey & parent, string const & filename)

parser.parse (nextToken, syntaxError, nullptr, nullptr, &root, &ambiguousOutput);

if (handleErrors (ambiguousOutput, errorListener, filename, grammar, parent) < 0) return -1;
if (handleErrors (ambiguousOutput, errorListener, filename, grammar, parent) < 0)
{
yaep::free_tree (root, nullptr, nullptr);
return -1;
}

Listener listener{ parent };
walk (listener, root);
Expand Down

0 comments on commit e8c4046

Please sign in to comment.