From 1d67e2753936e34fdfa0dec0b72e4527e86070de Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 14 Aug 2011 07:20:37 +0000 Subject: Various memory leaks and unnecessary checks removed by Oliver Stoneberg (no whatsnew) --- src/lib/util/options.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/lib/util/options.c') 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(); -- cgit v1.2.3-70-g09d2