diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-09-15 11:18:31 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-09-15 11:18:31 +0200 |
commit | 7dca6dacb90390e08df104ad983f8477f0af4a5b (patch) | |
tree | 3b002c029ded6e4265c82fd708497cc4a2fe4742 /src/exchangedb/perf_taler_exchangedb_interpreter.c | |
parent | cbfa5341949424c817beb15320ab7074088c6ac9 (diff) |
incomplete leak fixes
Diffstat (limited to 'src/exchangedb/perf_taler_exchangedb_interpreter.c')
-rw-r--r-- | src/exchangedb/perf_taler_exchangedb_interpreter.c | 15 |
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[]) static int cmd_clean (struct PERF_TALER_EXCHANGEDB_Cmd cmd[]) { - unsigned int i; - - for (i = 0; PERF_TALER_EXCHANGEDB_CMD_END != cmd[i].command; i++) + for (unsigned int i = 0; PERF_TALER_EXCHANGEDB_CMD_END != cmd[i].command; i++) { switch (cmd[i].command) { case PERF_TALER_EXCHANGEDB_CMD_SAVE_ARRAY: { - unsigned int j; - - for (j = 0; j < cmd[i].details.save_array.nb_saved; j++) + for (unsigned int j = 0; j < cmd[i].details.save_array.nb_saved; j++) { data_free (&cmd[i].details.save_array.data_saved[j]); } @@ -921,7 +917,9 @@ cmd_clean (struct PERF_TALER_EXCHANGEDB_Cmd cmd[]) GNUNET_free (cmd[i].details.load_array.permutation); cmd[i].details.load_array.permutation = NULL; break; - + case PERF_TALER_EXCHANGEDB_CMD_CREATE_WITHDRAW: + PERF_TALER_EXCHANGEDB_coin_free (cmd[i].exposed.data.coin); + break; default: break; } @@ -1578,7 +1576,10 @@ PERF_TALER_EXCHANGEDB_interpret (struct TALER_EXCHANGEDB_Plugin *db_plugin, return ret; state.session = db_plugin->get_session (db_plugin->cls); if (NULL == state.session) + { + cmd_clean (cmd); return GNUNET_SYSERR; + } GNUNET_assert (NULL != state.session); ret = interpret (&state); cmd_clean (cmd); |