diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-11-09 17:23:30 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-11-09 17:23:30 +0000 |
commit | 9d55674c58b63487c67b8539492b4315b561a7f1 (patch) | |
tree | 66cbf469d9b795879d43f5e9c2b7866c2e3e53cc /src/identity/identity_api.c | |
parent | 5f05e39051f6339e6908392f0ef212b42a5682fb (diff) | |
download | gnunet-9d55674c58b63487c67b8539492b4315b561a7f1.tar.gz gnunet-9d55674c58b63487c67b8539492b4315b561a7f1.zip |
-fix potential leak and awkward test behavior causing it
Diffstat (limited to 'src/identity/identity_api.c')
-rw-r--r-- | src/identity/identity_api.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c index 931deb509..38c9efdd4 100644 --- a/src/identity/identity_api.c +++ b/src/identity/identity_api.c | |||
@@ -952,13 +952,6 @@ GNUNET_IDENTITY_disconnect (struct GNUNET_IDENTITY_Handle *h) | |||
952 | struct GNUNET_IDENTITY_Operation *op; | 952 | struct GNUNET_IDENTITY_Operation *op; |
953 | 953 | ||
954 | GNUNET_assert (NULL != h); | 954 | GNUNET_assert (NULL != h); |
955 | while (NULL != (op = h->op_head)) | ||
956 | { | ||
957 | GNUNET_CONTAINER_DLL_remove (h->op_head, | ||
958 | h->op_tail, | ||
959 | op); | ||
960 | GNUNET_free (op); | ||
961 | } | ||
962 | if (h->reconnect_task != GNUNET_SCHEDULER_NO_TASK) | 955 | if (h->reconnect_task != GNUNET_SCHEDULER_NO_TASK) |
963 | { | 956 | { |
964 | GNUNET_SCHEDULER_cancel (h->reconnect_task); | 957 | GNUNET_SCHEDULER_cancel (h->reconnect_task); |
@@ -977,6 +970,14 @@ GNUNET_IDENTITY_disconnect (struct GNUNET_IDENTITY_Handle *h) | |||
977 | GNUNET_CONTAINER_multihashmap_destroy (h->egos); | 970 | GNUNET_CONTAINER_multihashmap_destroy (h->egos); |
978 | h->egos = NULL; | 971 | h->egos = NULL; |
979 | } | 972 | } |
973 | GNUNET_break (NULL == h->op_head); | ||
974 | while (NULL != (op = h->op_head)) | ||
975 | { | ||
976 | GNUNET_CONTAINER_DLL_remove (h->op_head, | ||
977 | h->op_tail, | ||
978 | op); | ||
979 | GNUNET_free (op); | ||
980 | } | ||
980 | if (NULL != h->client) | 981 | if (NULL != h->client) |
981 | { | 982 | { |
982 | GNUNET_CLIENT_disconnect (h->client); | 983 | GNUNET_CLIENT_disconnect (h->client); |