aboutsummaryrefslogtreecommitdiffstats
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/serenitas.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/serenitas.c b/sql/serenitas.c
index fab093b0..1ab3522b 100644
--- a/sql/serenitas.c
+++ b/sql/serenitas.c
@@ -84,8 +84,10 @@ Datum cds_accrued(PG_FUNCTION_ARGS) {
const char* cal = cal_from_currency(currency);
TDate date = TDate_from_DateADT(d) + 1;
TDate date1 = next_business_day(date, JPMCDS_BAD_DAY_PREVIOUS, cal);
- if (date1 == -1)
- elog(ERROR, "Please set up the US calendar in /usr/share/cds/US");
+ if (date1 == -1) {
+ pfree(currency);
+ elog(ERROR, "Please set up the US calendar in /usr/share/cds/NYM");
+ }
TDate date_prev = _previous_twentieth(date1, true, cal);