diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-11-26 22:30:41 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-11-26 22:30:41 +0000 |
commit | 73c61a51290216778e5e8b7152fcbd48ef1b3131 (patch) | |
tree | 0ea36432e7cc4d8a6600fc7b9513c37bee96a5f0 | |
parent | 913e4ee05b2f43142420101d817699f38ac22d15 (diff) | |
download | gnunet-73c61a51290216778e5e8b7152fcbd48ef1b3131.tar.gz gnunet-73c61a51290216778e5e8b7152fcbd48ef1b3131.zip |
-handle case where channel is NULL (failed to be created?), see #3125
-rw-r--r-- | src/fs/gnunet-service-fs_mesh_client.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/fs/gnunet-service-fs_mesh_client.c b/src/fs/gnunet-service-fs_mesh_client.c index dde32f96f..c30a38cf7 100644 --- a/src/fs/gnunet-service-fs_mesh_client.c +++ b/src/fs/gnunet-service-fs_mesh_client.c | |||
@@ -219,7 +219,8 @@ reset_mesh (struct MeshHandle *mh) | |||
219 | "Resetting mesh channel to %s\n", | 219 | "Resetting mesh channel to %s\n", |
220 | GNUNET_i2s (&mh->target)); | 220 | GNUNET_i2s (&mh->target)); |
221 | mh->channel = NULL; | 221 | mh->channel = NULL; |
222 | GNUNET_MESH_channel_destroy (channel); | 222 | if (NULL != channel) |
223 | GNUNET_MESH_channel_destroy (channel); | ||
223 | GNUNET_CONTAINER_multihashmap_iterate (mh->waiting_map, | 224 | GNUNET_CONTAINER_multihashmap_iterate (mh->waiting_map, |
224 | &move_to_pending, | 225 | &move_to_pending, |
225 | mh); | 226 | mh); |
@@ -294,9 +295,9 @@ reset_mesh_async (struct MeshHandle *mh) | |||
294 | * query via a mesh. | 295 | * query via a mesh. |
295 | * | 296 | * |
296 | * @param cls the struct MeshHandle for which we did the write call | 297 | * @param cls the struct MeshHandle for which we did the write call |
297 | * @param size the number of bytes that can be written to 'buf' | 298 | * @param size the number of bytes that can be written to @a buf |
298 | * @param buf where to write the message | 299 | * @param buf where to write the message |
299 | * @return number of bytes written to 'buf' | 300 | * @return number of bytes written to @a buf |
300 | */ | 301 | */ |
301 | static size_t | 302 | static size_t |
302 | transmit_sqm (void *cls, | 303 | transmit_sqm (void *cls, |
@@ -435,7 +436,7 @@ handle_reply (void *cls, | |||
435 | * @param channel channel handle | 436 | * @param channel channel handle |
436 | * @param channel_ctx channel context | 437 | * @param channel_ctx channel context |
437 | * @param message the actual message | 438 | * @param message the actual message |
438 | * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing | 439 | * @return #GNUNET_OK on success, #GNUNET_SYSERR to stop further processing |
439 | */ | 440 | */ |
440 | static int | 441 | static int |
441 | reply_cb (void *cls, | 442 | reply_cb (void *cls, |
@@ -549,7 +550,7 @@ get_mesh (const struct GNUNET_PeerIdentity *target) | |||
549 | * @param query hash to query for the block | 550 | * @param query hash to query for the block |
550 | * @param type desired type for the block | 551 | * @param type desired type for the block |
551 | * @param proc function to call with result | 552 | * @param proc function to call with result |
552 | * @param proc_cls closure for 'proc' | 553 | * @param proc_cls closure for @a proc |
553 | * @return handle to cancel the operation | 554 | * @return handle to cancel the operation |
554 | */ | 555 | */ |
555 | struct GSF_MeshRequest * | 556 | struct GSF_MeshRequest * |