diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/DHT.c | 2 | ||||
-rw-r--r-- | core/Lossless_UDP.c | 2 | ||||
-rw-r--r-- | core/Messenger.c | 2 | ||||
-rw-r--r-- | core/net_crypto.c | 2 |
4 files changed, 7 insertions, 1 deletions
@@ -1145,6 +1145,8 @@ static void do_toping(DHT * dht) | |||
1145 | 1145 | ||
1146 | DHT * new_DHT(Net_Crypto *c) | 1146 | DHT * new_DHT(Net_Crypto *c) |
1147 | { | 1147 | { |
1148 | if (c == NULL) | ||
1149 | return NULL; | ||
1148 | DHT * temp = calloc(1, sizeof(DHT)); | 1150 | DHT * temp = calloc(1, sizeof(DHT)); |
1149 | if (temp == NULL) | 1151 | if (temp == NULL) |
1150 | return NULL; | 1152 | return NULL; |
diff --git a/core/Lossless_UDP.c b/core/Lossless_UDP.c index 3e71ffbb..7ece28e1 100644 --- a/core/Lossless_UDP.c +++ b/core/Lossless_UDP.c | |||
@@ -719,6 +719,8 @@ static int handle_data(void * object, IP_Port source, uint8_t *packet, uint32_t | |||
719 | 719 | ||
720 | Lossless_UDP * new_lossless_udp(Networking_Core * net) | 720 | Lossless_UDP * new_lossless_udp(Networking_Core * net) |
721 | { | 721 | { |
722 | if(net == NULL) | ||
723 | return NULL; | ||
722 | Lossless_UDP * temp = calloc(1, sizeof(Lossless_UDP)); | 724 | Lossless_UDP * temp = calloc(1, sizeof(Lossless_UDP)); |
723 | if (temp == NULL) | 725 | if (temp == NULL) |
724 | return NULL; | 726 | return NULL; |
diff --git a/core/Messenger.c b/core/Messenger.c index a6cbb3ac..dcf0235f 100644 --- a/core/Messenger.c +++ b/core/Messenger.c | |||
@@ -625,7 +625,7 @@ Messenger *initMessenger(void) | |||
625 | { | 625 | { |
626 | Messenger *m = calloc(1, sizeof(Messenger)); | 626 | Messenger *m = calloc(1, sizeof(Messenger)); |
627 | if ( ! m ) | 627 | if ( ! m ) |
628 | return 0; | 628 | return NULL; |
629 | IP ip; | 629 | IP ip; |
630 | ip.i = 0; | 630 | ip.i = 0; |
631 | m->net = new_networking(ip, PORT); | 631 | m->net = new_networking(ip, PORT); |
diff --git a/core/net_crypto.c b/core/net_crypto.c index e36a1666..6c915f49 100644 --- a/core/net_crypto.c +++ b/core/net_crypto.c | |||
@@ -699,6 +699,8 @@ static void receive_crypto(Net_Crypto *c) | |||
699 | sets all the global connection variables to their default values. */ | 699 | sets all the global connection variables to their default values. */ |
700 | Net_Crypto * new_net_crypto(Networking_Core * net) | 700 | Net_Crypto * new_net_crypto(Networking_Core * net) |
701 | { | 701 | { |
702 | if (net == NULL) | ||
703 | return NULL; | ||
702 | Net_Crypto * temp = calloc(1, sizeof(Net_Crypto)); | 704 | Net_Crypto * temp = calloc(1, sizeof(Net_Crypto)); |
703 | if (temp == NULL) | 705 | if (temp == NULL) |
704 | return NULL; | 706 | return NULL; |