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/methods/null/null.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/methods/null/null.c') diff --git a/src/methods/null/null.c b/src/methods/null/null.c index 3062fcf..71191de 100644 --- a/src/methods/null/null.c +++ b/src/methods/null/null.c @@ -55,7 +55,7 @@ static size_t method_key_length(const fastd_method_t *method UNUSED) { /** Initiates a new null session */ static fastd_method_session_state_t* method_session_init(const fastd_method_t *method UNUSED, const uint8_t *secret UNUSED, 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); session->valid = true; session->initiator = initiator; -- cgit v1.2.3