diff options
author | irungentoo <irungentoo@gmail.com> | 2013-08-17 11:30:48 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-08-17 11:30:48 -0400 |
commit | f259ab5fa7a7175869134c05a92f569896fe85a2 (patch) | |
tree | 3f34e801bb8d7da5f9f0de4d4c79596d4202bdd3 | |
parent | 7d092c3467fbbcf3639ed2c698659c56b2509c31 (diff) |
Fixed bug.
-rw-r--r-- | core/Messenger.c | 2 | ||||
-rw-r--r-- | core/net_crypto.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/core/Messenger.c b/core/Messenger.c index 2c9e134b..2b5c8241 100644 --- a/core/Messenger.c +++ b/core/Messenger.c | |||
@@ -39,7 +39,7 @@ int realloc_friendlist(Messenger *m, uint32_t num) | |||
39 | { | 39 | { |
40 | Friend *newfriendlist = realloc(m->friendlist, num * sizeof(Friend)); | 40 | Friend *newfriendlist = realloc(m->friendlist, num * sizeof(Friend)); |
41 | 41 | ||
42 | if (newfriendlist == NULL) | 42 | if (newfriendlist == NULL && num != 0) |
43 | return -1; | 43 | return -1; |
44 | 44 | ||
45 | m->friendlist = newfriendlist; | 45 | m->friendlist = newfriendlist; |
diff --git a/core/net_crypto.c b/core/net_crypto.c index 2dbe12ad..7fdd035f 100644 --- a/core/net_crypto.c +++ b/core/net_crypto.c | |||
@@ -408,7 +408,7 @@ int realloc_cryptoconnection(uint32_t num) | |||
408 | { | 408 | { |
409 | Crypto_Connection *newcrypto_connections = realloc(crypto_connections, num * sizeof(Crypto_Connection)); | 409 | Crypto_Connection *newcrypto_connections = realloc(crypto_connections, num * sizeof(Crypto_Connection)); |
410 | 410 | ||
411 | if (newcrypto_connections == NULL) | 411 | if (newcrypto_connections == NULL && num != 0) |
412 | return -1; | 412 | return -1; |
413 | 413 | ||
414 | crypto_connections = newcrypto_connections; | 414 | crypto_connections = newcrypto_connections; |