diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-08-02 00:53:47 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-08-02 00:53:47 +0200 |
commit | 546ac7936340312cf272969ff83317ae4d50d2b4 (patch) | |
tree | 7ecadca11430c8624d9f80aae7c348fa4d65b969 /src/methods/xsalsa20_poly1305/xsalsa20_poly1305.c | |
parent | b22364f4af3564f0dd9a5f4e150bb09747bd5c4e (diff) | |
download | fastd-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/methods/xsalsa20_poly1305/xsalsa20_poly1305.c')
-rw-r--r-- | src/methods/xsalsa20_poly1305/xsalsa20_poly1305.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/methods/xsalsa20_poly1305/xsalsa20_poly1305.c b/src/methods/xsalsa20_poly1305/xsalsa20_poly1305.c index 9f2d61c..5a4966e 100644 --- a/src/methods/xsalsa20_poly1305/xsalsa20_poly1305.c +++ b/src/methods/xsalsa20_poly1305/xsalsa20_poly1305.c @@ -65,7 +65,7 @@ static size_t method_key_length(const fastd_method_t *method UNUSED) { /** Initializes the session state */ static fastd_method_session_state_t* method_session_init(const fastd_method_t *method UNUSED, const uint8_t *secret, bool initiator) { - fastd_method_session_state_t *session = malloc(sizeof(fastd_method_session_state_t)); + fastd_method_session_state_t *session = fastd_new(fastd_method_session_state_t); fastd_method_common_init(&session->common, initiator); |