summaryrefslogtreecommitdiffstats
path: root/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-08-02 00:53:47 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-08-02 00:53:47 +0200
commit546ac7936340312cf272969ff83317ae4d50d2b4 (patch)
tree7ecadca11430c8624d9f80aae7c348fa4d65b969 /src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
parentb22364f4af3564f0dd9a5f4e150bb09747bd5c4e (diff)
downloadfastd-546ac7936340312cf272969ff83317ae4d50d2b4.tar
fastd-546ac7936340312cf272969ff83317ae4d50d2b4.zip
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).
Diffstat (limited to 'src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c')
-rw-r--r--src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
index 86acbec..f9bf1f7 100644
--- a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
+++ b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
@@ -59,7 +59,7 @@ static inline void check_session_refresh(fastd_peer_t *peer) {
/** Initializes the protocol-specific configuration */
static fastd_protocol_config_t* protocol_init(void) {
- fastd_protocol_config_t *protocol_config = malloc(sizeof(fastd_protocol_config_t));
+ fastd_protocol_config_t *protocol_config = fastd_new(fastd_protocol_config_t);
if (!conf.secret)
exit_error("no secret key configured");
@@ -100,7 +100,7 @@ static void protocol_peer_configure(fastd_peer_config_t *peer_conf) {
return;
}
- peer_conf->protocol_config = malloc(sizeof(fastd_protocol_peer_config_t));
+ peer_conf->protocol_config = fastd_new(fastd_protocol_peer_config_t);
peer_conf->protocol_config->public_key = key;
if (memcmp(&peer_conf->protocol_config->public_key, &conf.protocol_config->key.public, PUBLICKEYBYTES) == 0)