Free leaking qdr_connection_t when the router core action has been discarded. This closes
@@ -1312,9 +1312,16 @@ void qdr_check_addr_CT(qdr_core_t *core, qdr_address_t *addr)
static void qdr_connection_opened_CT(qdr_core_t *core, qdr_action_t *action, bool discard)
{
-
qdr_connection_t *conn = safe_deref_qdr_connection_t(action->args.connection.conn);
- if (!discard && conn) {
+
+ if (!conn || discard) {
+ qdr_field_free(action->args.connection.connection_label);
+ qdr_field_free(action->args.connection.container_id);
+
+ if (conn)
+ qdr_connection_free(conn);
+ return;
+ }
do {
DEQ_ITEM_INIT(conn);
@@ -1379,7 +1386,6 @@ static void qdr_connection_opened_CT(qdr_core_t *core, qdr_action_t *action, boo
} while (false);
qdrc_event_conn_raise(core, QDRC_EVENT_CONN_OPENED, conn);
- }
qdr_field_free(action->args.connection.connection_label);
qdr_field_free(action->args.connection.container_id);
