summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-17 06:12:04 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-17 06:12:04 -0400
commit0f83b9f0c34e72c01730bb5cf0250f02a5c30a6e (patch)
tree5a9feedb4022b38a55a68ffafa54ff81b9785424
parent45f6aa3f93b9b1dce16c08bebb030fd25d87749a (diff)
downloadfork-ledger-0f83b9f0c34e72c01730bb5cf0250f02a5c30a6e.tar.gz
fork-ledger-0f83b9f0c34e72c01730bb5cf0250f02a5c30a6e.tar.bz2
fork-ledger-0f83b9f0c34e72c01730bb5cf0250f02a5c30a6e.zip
Moved the sequencing of a call to node.reset, since the intervening expression
can throw an exception which would leave us with an unexpected NULL pointer.
-rw-r--r--valexpr.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/valexpr.cc b/valexpr.cc
index d1cc9322..6afd0805 100644
--- a/valexpr.cc
+++ b/valexpr.cc
@@ -1035,8 +1035,8 @@ value_expr_t * parse_value_term(std::istream& in, scope_t * scope,
unexpected(c, ']');
in.get(c);
- node.reset(new value_expr_t(value_expr_t::CONSTANT));
interval_t timespan(buf);
+ node.reset(new value_expr_t(value_expr_t::CONSTANT));
node->value = new value_t(timespan.first());
break;
}