diff options
author | John Wiegley <johnw@newartisans.com> | 2004-08-19 03:28:48 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-08-19 03:28:48 -0400 |
commit | bf923ab33e9951d25611cb7193d6852e9113d929 (patch) | |
tree | 0c1f3b6367b42569ecfb297a5e3968fab742ac15 /walk.cc | |
parent | 965e1fc28f725e830a6f51a5d41e7a3850d15b12 (diff) | |
download | fork-ledger-bf923ab33e9951d25611cb7193d6852e9113d929.tar.gz fork-ledger-bf923ab33e9951d25611cb7193d6852e9113d929.tar.bz2 fork-ledger-bf923ab33e9951d25611cb7193d6852e9113d929.zip |
use std::auto_ptr wherever a thrown exception might otherwise leak memory
Diffstat (limited to 'walk.cc')
-rw-r--r-- | walk.cc | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -90,12 +90,11 @@ void changed_value_transactions::operator()(transaction_t * xact) if (balance_t diff = cur_bal - prev_bal) { entry_t * entry = new entry_t; + entry_temps.push_back(entry); entry->payee = "Commodities revalued"; entry->date = current; - entry_temps.push_back(entry); - for (amounts_map::const_iterator i = diff.amounts.begin(); i != diff.amounts.end(); i++) { @@ -138,10 +137,10 @@ void subtotal_transactions::flush(const char * spec_fmt) } entry_t * entry = new entry_t; - entry->payee = buf; - entry_temps.push_back(entry); + entry->payee = buf; + for (balances_map::iterator i = balances.begin(); i != balances.end(); i++) { |