From 4610ade056855f0e03457857d0f704c6d5b689f2 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Sun, 3 Jun 2012 10:29:41 -0700 Subject: Fix more load/commit memory leaks This fixes some more of the memory leaks in load and commit. Some still exist in the legacy cli_new/cli_parse code. Since that code is supposed to be rewritten such that it interfaces with the rewritten commit code in a clean way, these will not be fixed right now. --- src/cstore/cstore.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/cstore') diff --git a/src/cstore/cstore.cpp b/src/cstore/cstore.cpp index aacd15a..cc8a029 100644 --- a/src/cstore/cstore.cpp +++ b/src/cstore/cstore.cpp @@ -1827,6 +1827,7 @@ Cstore::loadFile(const char *filename) // get the config tree from the file CfgNode *froot = cparse::parse_file(fin, *this); + fclose(fin); if (!froot) { output_user("Failed to parse specified config file\n"); return false; @@ -1842,6 +1843,7 @@ Cstore::loadFile(const char *filename) vector com_list; get_cmds_diff(aroot, *froot, del_list, set_list, com_list); + delete froot; // "apply" the changes to the working config for (size_t i = 0; i < del_list.size(); i++) { if (!deleteCfgPath(del_list[i])) { -- cgit v1.2.3