From 15e55a72c96d069ac2551856be5b7d5efdb617db Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 21 Apr 2025 15:13:36 -0400 Subject: [PATCH] Use FREE_AND_NULL with conflux_msg_t. --- src/core/or/conflux.c | 2 +- src/core/or/conflux.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/or/conflux.c b/src/core/or/conflux.c index b657eb00ef..c444f690dc 100644 --- a/src/core/or/conflux.c +++ b/src/core/or/conflux.c @@ -917,7 +917,7 @@ conflux_dequeue_relay_msg(conflux_t *cfx) /** Free a given conflux msg object. */ void -conflux_relay_msg_free(conflux_msg_t *msg) +conflux_relay_msg_free_(conflux_msg_t *msg) { if (msg) { relay_msg_free(msg->msg); diff --git a/src/core/or/conflux.h b/src/core/or/conflux.h index 1594039e26..ecb47707c2 100644 --- a/src/core/or/conflux.h +++ b/src/core/or/conflux.h @@ -63,7 +63,9 @@ bool conflux_process_relay_msg(conflux_t *cfx, circuit_t *in_circ, conflux_msg_t *conflux_dequeue_relay_msg(conflux_t *cfx); void conflux_note_cell_sent(conflux_t *cfx, circuit_t *circ, uint8_t relay_command); -void conflux_relay_msg_free(conflux_msg_t *msg); +void conflux_relay_msg_free_(conflux_msg_t *msg); +#define conflux_relay_msg_free(msg) \ + FREE_AND_NULL(conflux_msg_t, conflux_relay_msg_free_, (msg)) /* Private section starts. */ #ifdef TOR_CONFLUX_PRIVATE -- 2.47.2