summaryrefslogtreecommitdiff
path: root/src/cstore
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2012-06-03 10:29:41 -0700
committerJohn Southworth <john.southworth@vyatta.com>2012-06-03 10:29:41 -0700
commit4610ade056855f0e03457857d0f704c6d5b689f2 (patch)
tree32e5e8afca43ac814d7d087fb7d1161340375fdd /src/cstore
parent6c4cf990bf4ea521f602a6d4e8ac4d51de461da9 (diff)
downloadvyatta-cfg-4610ade056855f0e03457857d0f704c6d5b689f2.tar.gz
vyatta-cfg-4610ade056855f0e03457857d0f704c6d5b689f2.zip
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.
Diffstat (limited to 'src/cstore')
-rw-r--r--src/cstore/cstore.cpp2
1 files changed, 2 insertions, 0 deletions
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<Cpath> 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])) {