summaryrefslogtreecommitdiff
path: root/auto_tests/TCP_test.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2020-05-03 01:09:06 +0100
committeriphydf <iphydf@users.noreply.github.com>2020-05-03 14:13:48 +0000
commit88b90c82259f86470cf6eba8684e8d9b4cd61bc3 (patch)
tree90e052389ffacec791019a096837a670e205b225 /auto_tests/TCP_test.c
parent7b758f66dbc550fa52ed66fd7f8b81f8ed37a94e (diff)
Fix a bug in savedata loading when malloc fails.
Also added a bunch of asserts to tests where they don't check allocs.
Diffstat (limited to 'auto_tests/TCP_test.c')
-rw-r--r--auto_tests/TCP_test.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/auto_tests/TCP_test.c b/auto_tests/TCP_test.c
index 9206e265..8a109317 100644
--- a/auto_tests/TCP_test.c
+++ b/auto_tests/TCP_test.c
@@ -185,6 +185,7 @@ struct sec_TCP_con {
185static struct sec_TCP_con *new_TCP_con(TCP_Server *tcp_s, Mono_Time *mono_time) 185static struct sec_TCP_con *new_TCP_con(TCP_Server *tcp_s, Mono_Time *mono_time)
186{ 186{
187 struct sec_TCP_con *sec_c = (struct sec_TCP_con *)malloc(sizeof(struct sec_TCP_con)); 187 struct sec_TCP_con *sec_c = (struct sec_TCP_con *)malloc(sizeof(struct sec_TCP_con));
188 ck_assert(sec_c != nullptr);
188 Socket sock = net_socket(net_family_ipv6, TOX_SOCK_STREAM, TOX_PROTO_TCP); 189 Socket sock = net_socket(net_family_ipv6, TOX_SOCK_STREAM, TOX_PROTO_TCP);
189 190
190 IP_Port ip_port_loopback; 191 IP_Port ip_port_loopback;