diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-04-06 00:36:45 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-04-06 00:36:45 +0200 |
commit | cb1548d1a080e8d05624482534205318796a802f (patch) | |
tree | c3f6cc91575db3f50adbf6e0e459404a6444d748 | |
parent | 2e65fa836689bf343ec71e44be8eee77e21ee442 (diff) | |
download | exchange-cb1548d1a080e8d05624482534205318796a802f.tar.xz |
avoid dangling pointer
-rw-r--r-- | src/wire/plugin_wire_test.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/wire/plugin_wire_test.c b/src/wire/plugin_wire_test.c index 11feaea7e..a81ccdad9 100644 --- a/src/wire/plugin_wire_test.c +++ b/src/wire/plugin_wire_test.c @@ -869,6 +869,12 @@ bhist_cb (void *cls, GNUNET_free (subject); wd.account_details = details->account_details; + GNUNET_break (NULL != whh->hh); + + /* Once we get the sentinel element, the handle becomes invalid. */ + if (TALER_BANK_DIRECTION_NONE == dir) + whh->hh = NULL; + if ( (NULL != whh->hres_cb) && (GNUNET_OK != whh->hres_cb (whh->hres_cb_cls, @@ -1007,7 +1013,11 @@ static void test_get_history_cancel (void *cls, struct TALER_WIRE_HistoryHandle *whh) { - TALER_BANK_history_cancel (whh->hh); + if (NULL != whh->hh) + { + TALER_BANK_history_cancel (whh->hh); + whh->hh = NULL; + } GNUNET_free (whh); } |