aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/perf_taler_exchangedb_interpreter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchangedb/perf_taler_exchangedb_interpreter.c')
-rw-r--r--src/exchangedb/perf_taler_exchangedb_interpreter.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/exchangedb/perf_taler_exchangedb_interpreter.c b/src/exchangedb/perf_taler_exchangedb_interpreter.c
index 8286966c2..b96db493d 100644
--- a/src/exchangedb/perf_taler_exchangedb_interpreter.c
+++ b/src/exchangedb/perf_taler_exchangedb_interpreter.c
@@ -898,17 +898,13 @@ cmd_init (struct PERF_TALER_EXCHANGEDB_Cmd cmd[])
898static int 898static int
899cmd_clean (struct PERF_TALER_EXCHANGEDB_Cmd cmd[]) 899cmd_clean (struct PERF_TALER_EXCHANGEDB_Cmd cmd[])
900{ 900{
901 unsigned int i; 901 for (unsigned int i = 0; PERF_TALER_EXCHANGEDB_CMD_END != cmd[i].command; i++)
902
903 for (i = 0; PERF_TALER_EXCHANGEDB_CMD_END != cmd[i].command; i++)
904 { 902 {
905 switch (cmd[i].command) 903 switch (cmd[i].command)
906 { 904 {
907 case PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY: 905 case PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY:
908 { 906 {
909 unsigned int j; 907 for (unsigned int j = 0; j < cmd[i].details.save_array.nb_saved; j++)
910
911 for (j = 0; j < cmd[i].details.save_array.nb_saved; j++)
912 { 908 {
913 data_free (&cmd[i].details.save_array.data_saved[j]); 909 data_free (&cmd[i].details.save_array.data_saved[j]);
914 } 910 }
@@ -921,7 +917,9 @@ cmd_clean (struct PERF_TALER_EXCHANGEDB_Cmd cmd[])
921 GNUNET_free (cmd[i].details.load_array.permutation); 917 GNUNET_free (cmd[i].details.load_array.permutation);
922 cmd[i].details.load_array.permutation = NULL; 918 cmd[i].details.load_array.permutation = NULL;
923 break; 919 break;
924 920 case PERF_TALER_EXCHANGEDB_CMD_CREATE_WITHDRAW:
921 PERF_TALER_EXCHANGEDB_coin_free (cmd[i].exposed.data.coin);
922 break;
925 default: 923 default:
926 break; 924 break;
927 } 925 }
@@ -1578,7 +1576,10 @@ PERF_TALER_EXCHANGEDB_interpret (struct TALER_EXCHANGEDB_Plugin *db_plugin,
1578 return ret; 1576 return ret;
1579 state.session = db_plugin->get_session (db_plugin->cls); 1577 state.session = db_plugin->get_session (db_plugin->cls);
1580 if (NULL == state.session) 1578 if (NULL == state.session)
1579 {
1580 cmd_clean (cmd);
1581 return GNUNET_SYSERR; 1581 return GNUNET_SYSERR;
1582 }
1582 GNUNET_assert (NULL != state.session); 1583 GNUNET_assert (NULL != state.session);
1583 ret = interpret (&state); 1584 ret = interpret (&state);
1584 cmd_clean (cmd); 1585 cmd_clean (cmd);