summaryrefslogtreecommitdiff
path: root/walk.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-19 03:28:48 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-19 03:28:48 -0400
commitbf923ab33e9951d25611cb7193d6852e9113d929 (patch)
tree0c1f3b6367b42569ecfb297a5e3968fab742ac15 /walk.cc
parent965e1fc28f725e830a6f51a5d41e7a3850d15b12 (diff)
downloadfork-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.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/walk.cc b/walk.cc
index 908618b5..8b9f3874 100644
--- a/walk.cc
+++ b/walk.cc
@@ -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++) {