From 546ac7936340312cf272969ff83317ae4d50d2b4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 2 Aug 2014 00:53:47 +0200 Subject: Introduce and use alloc helpers These new helpers will terminate fastd on allocation failures and add some additional convenience (allow strdup with NULL; typesafe new(type) macros). --- src/protocols/ec25519_fhmqvc/handshake.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/protocols/ec25519_fhmqvc/handshake.c') diff --git a/src/protocols/ec25519_fhmqvc/handshake.c b/src/protocols/ec25519_fhmqvc/handshake.c index 99f1829..9a1c8de 100644 --- a/src/protocols/ec25519_fhmqvc/handshake.c +++ b/src/protocols/ec25519_fhmqvc/handshake.c @@ -580,7 +580,7 @@ static fastd_peer_t * add_temporary(fastd_socket_t *sock, const fastd_peer_addre fastd_peer_t *peer = fastd_peer_add(NULL); - peer->protocol_config = malloc(sizeof(fastd_protocol_peer_config_t)); + peer->protocol_config = fastd_new(fastd_protocol_peer_config_t); memcpy(&peer->protocol_config->public_key, key, PUBLICKEYBYTES); /* Ugly hack */ -- cgit v1.2.3