diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/net_crypto.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/net_crypto.c b/core/net_crypto.c index 7fdd035f..6ced942b 100644 --- a/core/net_crypto.c +++ b/core/net_crypto.c | |||
@@ -406,6 +406,8 @@ static int getcryptconnection_id(uint8_t *public_key) | |||
406 | return -1 if realloc fails */ | 406 | return -1 if realloc fails */ |
407 | int realloc_cryptoconnection(uint32_t num) | 407 | int realloc_cryptoconnection(uint32_t num) |
408 | { | 408 | { |
409 | if (num * sizeof(Crypto_Connection) == 0) return -1; | ||
410 | |||
409 | Crypto_Connection *newcrypto_connections = realloc(crypto_connections, num * sizeof(Crypto_Connection)); | 411 | Crypto_Connection *newcrypto_connections = realloc(crypto_connections, num * sizeof(Crypto_Connection)); |
410 | 412 | ||
411 | if (newcrypto_connections == NULL && num != 0) | 413 | if (newcrypto_connections == NULL && num != 0) |