diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-06-25 00:42:25 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-06-25 00:42:25 +0200 |
commit | e15ee8365a5eb40aaf2448c4f649af30297d6817 (patch) | |
tree | 71e42aac4549c0b17f8a273141a7ed18cc231f34 /src/block | |
parent | e29410cee115f099f093605692ec94614fbbe6d9 (diff) | |
download | gnunet-e15ee8365a5eb40aaf2448c4f649af30297d6817.tar.gz gnunet-e15ee8365a5eb40aaf2448c4f649af30297d6817.zip |
fix crash if block plugin not found
Diffstat (limited to 'src/block')
-rw-r--r-- | src/block/block.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/block/block.c b/src/block/block.c index 4b6f3826d..bbf45477c 100644 --- a/src/block/block.c +++ b/src/block/block.c | |||
@@ -151,10 +151,9 @@ GNUNET_BLOCK_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
151 | void | 151 | void |
152 | GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx) | 152 | GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx) |
153 | { | 153 | { |
154 | unsigned int i; | ||
155 | struct Plugin *plugin; | 154 | struct Plugin *plugin; |
156 | 155 | ||
157 | for (i = 0; i < ctx->num_plugins; i++) | 156 | for (unsigned int i = 0; i < ctx->num_plugins; i++) |
158 | { | 157 | { |
159 | plugin = ctx->plugins[i]; | 158 | plugin = ctx->plugins[i]; |
160 | GNUNET_break (NULL == | 159 | GNUNET_break (NULL == |
@@ -301,6 +300,8 @@ GNUNET_BLOCK_group_create (struct GNUNET_BLOCK_Context *ctx, | |||
301 | 300 | ||
302 | plugin = find_plugin (ctx, | 301 | plugin = find_plugin (ctx, |
303 | type); | 302 | type); |
303 | if (NULL == plugin) | ||
304 | return NULL; | ||
304 | if (NULL == plugin->create_group) | 305 | if (NULL == plugin->create_group) |
305 | return NULL; | 306 | return NULL; |
306 | va_start (ap, | 307 | va_start (ap, |