aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/pg_insert_records_by_table.c9
-rw-r--r--src/exchangedb/pg_lookup_records_by_table.c10
2 files changed, 12 insertions, 7 deletions
diff --git a/src/exchangedb/pg_insert_records_by_table.c b/src/exchangedb/pg_insert_records_by_table.c
index d6630797a..1ccf41b42 100644
--- a/src/exchangedb/pg_insert_records_by_table.c
+++ b/src/exchangedb/pg_insert_records_by_table.c
@@ -1877,7 +1877,7 @@ TEH_PG_insert_records_by_table (void *cls,
const struct TALER_EXCHANGEDB_TableData *td)
{
struct PostgresClosure *pg = cls;
- InsertRecordCallback rh;
+ InsertRecordCallback rh = NULL;
switch (td->table)
{
@@ -2007,7 +2007,10 @@ TEH_PG_insert_records_by_table (void *cls,
case TALER_EXCHANGEDB_RT_PROFIT_DRAINS:
rh = &irbt_cb_table_profit_drains;
break;
- default:
+ }
+
+ if (NULL == rh)
+ {
GNUNET_break (0);
return GNUNET_DB_STATUS_HARD_ERROR;
}
@@ -2016,4 +2019,4 @@ TEH_PG_insert_records_by_table (void *cls,
}
-/* end of irbt_callbacks.c */
+/* end of pg_insert_records_by_table.c */
diff --git a/src/exchangedb/pg_lookup_records_by_table.c b/src/exchangedb/pg_lookup_records_by_table.c
index 806896e78..aa9ab046d 100644
--- a/src/exchangedb/pg_lookup_records_by_table.c
+++ b/src/exchangedb/pg_lookup_records_by_table.c
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet
- Copyright (C) 2020, 2021, 2022 Taler Systems SA
+ Copyright (C) 2020-2023 Taler Systems SA
GNUnet is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published
@@ -2321,8 +2321,8 @@ TEH_PG_lookup_records_by_table (void *cls,
.cb = cb,
.cb_cls = cb_cls
};
- GNUNET_PQ_PostgresResultHandler rh;
- const char *statement;
+ GNUNET_PQ_PostgresResultHandler rh = NULL;
+ const char *statement = NULL;
enum GNUNET_DB_QueryStatus qs;
switch (table)
@@ -2885,7 +2885,9 @@ TEH_PG_lookup_records_by_table (void *cls,
" ORDER BY profit_drain_serial_id ASC;");
rh = &lrbt_cb_table_profit_drains;
break;
- default:
+ }
+ if (NULL == rh)
+ {
GNUNET_break (0);
return GNUNET_DB_STATUS_HARD_ERROR;
}