diff options
author | jospaeth <spaethj@in.tum.de> | 2020-08-06 13:38:02 +0200 |
---|---|---|
committer | jospaeth <spaethj@in.tum.de> | 2020-08-06 13:38:02 +0200 |
commit | f7272dfc42de5b4cd0f9b27308e82e91d5f64ee3 (patch) | |
tree | c68787f40afde50821ae55eb8ada4aa0c6225dc2 | |
parent | 8c3c9d1ae8086a8498b0e5159b8168fb47bf50e0 (diff) | |
download | gnunet-f7272dfc42de5b4cd0f9b27308e82e91d5f64ee3.tar.gz gnunet-f7272dfc42de5b4cd0f9b27308e82e91d5f64ee3.zip |
fix double free
-rw-r--r-- | src/escrow/escrow_api.c | 6 | ||||
-rw-r--r-- | src/escrow/gnunet-escrow.c | 9 |
2 files changed, 4 insertions, 11 deletions
diff --git a/src/escrow/escrow_api.c b/src/escrow/escrow_api.c index ff1943f06..510f6a898 100644 --- a/src/escrow/escrow_api.c +++ b/src/escrow/escrow_api.c | |||
@@ -197,14 +197,12 @@ handle_start_escrow_result (void *cls) | |||
197 | if (NULL == op) | 197 | if (NULL == op) |
198 | { | 198 | { |
199 | GNUNET_break (0); | 199 | GNUNET_break (0); |
200 | GNUNET_free (w); | ||
201 | return; | 200 | return; |
202 | } | 201 | } |
203 | GNUNET_CONTAINER_DLL_remove (w->h->op_head, w->h->op_tail, op); | 202 | GNUNET_CONTAINER_DLL_remove (w->h->op_head, w->h->op_tail, op); |
204 | if (NULL != op->cb_put) | 203 | if (NULL != op->cb_put) |
205 | op->cb_put (op->cb_cls, w->escrowAnchor); | 204 | op->cb_put (op->cb_cls, w->escrowAnchor); |
206 | GNUNET_free (op); | 205 | GNUNET_free (op); |
207 | GNUNET_free (w); | ||
208 | } | 206 | } |
209 | 207 | ||
210 | 208 | ||
@@ -256,14 +254,12 @@ handle_restore_key_result (void *cls) | |||
256 | if (NULL == op) | 254 | if (NULL == op) |
257 | { | 255 | { |
258 | GNUNET_break (0); | 256 | GNUNET_break (0); |
259 | GNUNET_free (w); | ||
260 | return; | 257 | return; |
261 | } | 258 | } |
262 | GNUNET_CONTAINER_DLL_remove (w->h->op_head, w->h->op_tail, op); | 259 | GNUNET_CONTAINER_DLL_remove (w->h->op_head, w->h->op_tail, op); |
263 | if (NULL != op->cb_get) | 260 | if (NULL != op->cb_get) |
264 | op->cb_get (op->cb_cls, w->ego); | 261 | op->cb_get (op->cb_cls, w->ego); |
265 | GNUNET_free (op); | 262 | GNUNET_free (op); |
266 | GNUNET_free (w); | ||
267 | } | 263 | } |
268 | 264 | ||
269 | 265 | ||
@@ -317,7 +313,6 @@ handle_verify_escrow_result (void *cls) | |||
317 | if (NULL == op) | 313 | if (NULL == op) |
318 | { | 314 | { |
319 | GNUNET_break (0); | 315 | GNUNET_break (0); |
320 | GNUNET_free (w); | ||
321 | return; | 316 | return; |
322 | } | 317 | } |
323 | GNUNET_CONTAINER_DLL_remove (w->h->op_head, w->h->op_tail, op); | 318 | GNUNET_CONTAINER_DLL_remove (w->h->op_head, w->h->op_tail, op); |
@@ -326,7 +321,6 @@ handle_verify_escrow_result (void *cls) | |||
326 | GNUNET_free (op->plugin_op_wrap->plugin_op); | 321 | GNUNET_free (op->plugin_op_wrap->plugin_op); |
327 | GNUNET_free (op->plugin_op_wrap); | 322 | GNUNET_free (op->plugin_op_wrap); |
328 | GNUNET_free (op); | 323 | GNUNET_free (op); |
329 | GNUNET_free (w); | ||
330 | } | 324 | } |
331 | 325 | ||
332 | 326 | ||
diff --git a/src/escrow/gnunet-escrow.c b/src/escrow/gnunet-escrow.c index 5ed4576cd..32510587b 100644 --- a/src/escrow/gnunet-escrow.c +++ b/src/escrow/gnunet-escrow.c | |||
@@ -128,16 +128,15 @@ static void | |||
128 | do_cleanup (void *cls) | 128 | do_cleanup (void *cls) |
129 | { | 129 | { |
130 | cleanup_task = NULL; | 130 | cleanup_task = NULL; |
131 | if (NULL != escrow_handle) | ||
132 | GNUNET_ESCROW_fini (escrow_handle); | ||
133 | if (NULL != identity_handle) | ||
134 | GNUNET_IDENTITY_disconnect (identity_handle); | ||
135 | if (NULL != escrow_op) | 131 | if (NULL != escrow_op) |
136 | { | 132 | { |
137 | GNUNET_ESCROW_cancel (escrow_op); | 133 | GNUNET_ESCROW_cancel (escrow_op); |
138 | GNUNET_free (escrow_op); | ||
139 | escrow_op = NULL; | 134 | escrow_op = NULL; |
140 | } | 135 | } |
136 | if (NULL != escrow_handle) | ||
137 | GNUNET_ESCROW_fini (escrow_handle); | ||
138 | if (NULL != identity_handle) | ||
139 | GNUNET_IDENTITY_disconnect (identity_handle); | ||
141 | if (NULL != method_name) | 140 | if (NULL != method_name) |
142 | { | 141 | { |
143 | GNUNET_free (method_name); | 142 | GNUNET_free (method_name); |