summaryrefslogtreecommitdiff
path: root/datetime.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 /datetime.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 'datetime.cc')
-rw-r--r--datetime.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/datetime.cc b/datetime.cc
index 0714c4ad..5ddcecd2 100644
--- a/datetime.cc
+++ b/datetime.cc
@@ -90,9 +90,9 @@ static void parse_inclusion_specifier(const std::string& word,
*end = interval_t(0, saw_mon ? 1 : 0, saw_year ? 1 : 0).increment(*begin);
}
-interval_t * interval_t::parse(std::istream& in,
- std::time_t * begin,
- std::time_t * end)
+interval_t interval_t::parse(std::istream& in,
+ std::time_t * begin,
+ std::time_t * end)
{
unsigned long years = 0;
unsigned long months = 0;
@@ -203,7 +203,8 @@ interval_t * interval_t::parse(std::istream& in,
parse_inclusion_specifier(word, begin, end);
}
}
- return new interval_t(seconds, months, years);
+
+ return interval_t(seconds, months, years);
}
bool parse_date_mask(const char * date_str, struct std::tm * result)