summaryrefslogtreecommitdiff
path: root/src/bank-lib/bank_api_debit.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-20 12:34:26 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-20 12:34:26 +0100
commit2021f75995732d760323eca1d1844bc29f0ac976 (patch)
tree6f10dd0d7a53950370aba8c5d650e3cbcb9df0ae /src/bank-lib/bank_api_debit.c
parent10c56bcea05df9ac5a7036850039900fbe435e00 (diff)
downloadexchange-2021f75995732d760323eca1d1844bc29f0ac976.tar.gz
exchange-2021f75995732d760323eca1d1844bc29f0ac976.tar.bz2
exchange-2021f75995732d760323eca1d1844bc29f0ac976.zip
fix logic to ensure that we do not call the callback after the iteration was aborted (caused big trouble in wirewatcher)
Diffstat (limited to 'src/bank-lib/bank_api_debit.c')
-rw-r--r--src/bank-lib/bank_api_debit.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/bank-lib/bank_api_debit.c b/src/bank-lib/bank_api_debit.c
index 1418492e..33ff20ef 100644
--- a/src/bank-lib/bank_api_debit.c
+++ b/src/bank-lib/bank_api_debit.c
@@ -115,12 +115,18 @@ parse_account_history (struct TALER_BANK_DebitHistoryHandle *hh,
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- hh->hcb (hh->hcb_cls,
- MHD_HTTP_OK,
- TALER_EC_NONE,
- row_id,
- &td,
- transaction);
+ if (GNUNET_OK !=
+ hh->hcb (hh->hcb_cls,
+ MHD_HTTP_OK,
+ TALER_EC_NONE,
+ row_id,
+ &td,
+ transaction))
+ {
+ hh->hcb = NULL;
+ GNUNET_JSON_parse_free (hist_spec);
+ return GNUNET_OK;
+ }
GNUNET_JSON_parse_free (hist_spec);
}
return GNUNET_OK;
@@ -199,12 +205,13 @@ handle_debit_history_finished (void *cls,
response_code = 0;
break;
}
- hh->hcb (hh->hcb_cls,
- response_code,
- ec,
- 0LLU,
- NULL,
- j);
+ if (NULL != hh->hcb)
+ hh->hcb (hh->hcb_cls,
+ response_code,
+ ec,
+ 0LLU,
+ NULL,
+ j);
TALER_BANK_debit_history_cancel (hh);
}