diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-06-19 22:45:09 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-06-19 22:45:09 +0000 |
commit | 42f625fe75fce04175965b12d1edb809b56433af (patch) | |
tree | c3dd1ad8de1d2db58fe18fd0c16a3cef3765ef73 /src/scalarproduct | |
parent | 9a0a4efca26978f8e01513dfa291747e24907e3f (diff) | |
download | gnunet-42f625fe75fce04175965b12d1edb809b56433af.tar.gz gnunet-42f625fe75fce04175965b12d1edb809b56433af.zip |
avoid assertion on NULL mq
Diffstat (limited to 'src/scalarproduct')
-rw-r--r-- | src/scalarproduct/gnunet-service-scalarproduct_alice.c | 12 | ||||
-rw-r--r-- | src/scalarproduct/gnunet-service-scalarproduct_bob.c | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/scalarproduct/gnunet-service-scalarproduct_alice.c b/src/scalarproduct/gnunet-service-scalarproduct_alice.c index 7eb2d006c..d6da754f4 100644 --- a/src/scalarproduct/gnunet-service-scalarproduct_alice.c +++ b/src/scalarproduct/gnunet-service-scalarproduct_alice.c | |||
@@ -447,18 +447,18 @@ cb_channel_destruction (void *cls, | |||
447 | "Peer disconnected, terminating session %s with peer %s\n", | 447 | "Peer disconnected, terminating session %s with peer %s\n", |
448 | GNUNET_h2s (&s->session_id), | 448 | GNUNET_h2s (&s->session_id), |
449 | GNUNET_i2s (&s->peer)); | 449 | GNUNET_i2s (&s->peer)); |
450 | if (NULL != s->cadet_mq) | ||
451 | { | ||
452 | GNUNET_MQ_destroy (s->cadet_mq); | ||
453 | s->cadet_mq = NULL; | ||
454 | } | ||
455 | s->channel = NULL; | ||
456 | if (GNUNET_SCALARPRODUCT_STATUS_ACTIVE == s->status) | 450 | if (GNUNET_SCALARPRODUCT_STATUS_ACTIVE == s->status) |
457 | { | 451 | { |
458 | /* We didn't get an answer yet, fail with error */ | 452 | /* We didn't get an answer yet, fail with error */ |
459 | s->status = GNUNET_SCALARPRODUCT_STATUS_FAILURE; | 453 | s->status = GNUNET_SCALARPRODUCT_STATUS_FAILURE; |
460 | prepare_client_end_notification (s); | 454 | prepare_client_end_notification (s); |
461 | } | 455 | } |
456 | if (NULL != s->cadet_mq) | ||
457 | { | ||
458 | GNUNET_MQ_destroy (s->cadet_mq); | ||
459 | s->cadet_mq = NULL; | ||
460 | } | ||
461 | s->channel = NULL; | ||
462 | } | 462 | } |
463 | 463 | ||
464 | 464 | ||
diff --git a/src/scalarproduct/gnunet-service-scalarproduct_bob.c b/src/scalarproduct/gnunet-service-scalarproduct_bob.c index 79a0e961a..7341317b7 100644 --- a/src/scalarproduct/gnunet-service-scalarproduct_bob.c +++ b/src/scalarproduct/gnunet-service-scalarproduct_bob.c | |||
@@ -497,12 +497,6 @@ cb_channel_destruction (void *cls, | |||
497 | "Peer disconnected, terminating session %s with peer %s\n", | 497 | "Peer disconnected, terminating session %s with peer %s\n", |
498 | GNUNET_h2s (&in->session_id), | 498 | GNUNET_h2s (&in->session_id), |
499 | GNUNET_i2s (&in->peer)); | 499 | GNUNET_i2s (&in->peer)); |
500 | if (NULL != in->cadet_mq) | ||
501 | { | ||
502 | GNUNET_MQ_destroy (in->cadet_mq); | ||
503 | in->cadet_mq = NULL; | ||
504 | } | ||
505 | in->channel = NULL; | ||
506 | if (NULL != (s = in->s)) | 500 | if (NULL != (s = in->s)) |
507 | { | 501 | { |
508 | if (GNUNET_SCALARPRODUCT_STATUS_ACTIVE == s->status) | 502 | if (GNUNET_SCALARPRODUCT_STATUS_ACTIVE == s->status) |
@@ -511,6 +505,12 @@ cb_channel_destruction (void *cls, | |||
511 | prepare_client_end_notification (s); | 505 | prepare_client_end_notification (s); |
512 | } | 506 | } |
513 | } | 507 | } |
508 | if (NULL != in->cadet_mq) | ||
509 | { | ||
510 | GNUNET_MQ_destroy (in->cadet_mq); | ||
511 | in->cadet_mq = NULL; | ||
512 | } | ||
513 | in->channel = NULL; | ||
514 | destroy_cadet_session (in); | 514 | destroy_cadet_session (in); |
515 | } | 515 | } |
516 | 516 | ||