summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/options.c
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2011-08-14 07:20:37 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2011-08-14 07:20:37 +0000
commit1d67e2753936e34fdfa0dec0b72e4527e86070de (patch)
treedd330075a70ed9cbbfb9b330fc1173f07fbded39 /src/lib/util/options.c
parentb0e77ca0eed28841cf37018131934dfddab8dce2 (diff)
Various memory leaks and unnecessary checks removed by Oliver Stoneberg (no whatsnew)
Diffstat (limited to 'src/lib/util/options.c')
-rw-r--r--src/lib/util/options.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/util/options.c b/src/lib/util/options.c
index ac7897fb6d3..9e7dbaeed08 100644
--- a/src/lib/util/options.c
+++ b/src/lib/util/options.c
@@ -224,7 +224,11 @@ core_options::~core_options()
{
// delete all entries from the list
while (m_entrylist != NULL)
+ {
+ core_options::entry *e = m_entrylist;
remove_entry(*m_entrylist);
+ delete e;
+ }
}
@@ -290,7 +294,11 @@ void core_options::add_entries(const options_entry *entrylist, bool override_exi
{
// if we're overriding existing entries, then remove the old one
if (override_existing)
+ {
+ core_options::entry *e = m_entrylist;
remove_entry(*existing);
+ delete e;
+ }
// otherwise, just override the default and current values and throw out the new entry
else
@@ -608,7 +616,11 @@ void core_options::reset()
{
// remove all entries from the list
while (m_entrylist != NULL)
+ {
+ core_options::entry *e = m_entrylist;
remove_entry(*m_entrylist);
+ delete e;
+ }
// reset the map
m_entrymap.reset();