From 890f81df67966213698f2b40fe2dca6df25d19a7 Mon Sep 17 00:00:00 2001 From: Haiyue Wang Date: Mon, 16 Mar 2026 09:31:05 +0800 Subject: [PATCH] mctpd: initialize peer to NULL to fix error path Initialize peer to NULL to avoid using an uninitialized pointer in the error path when sd_bus_message_read() fails to get 'eid'. Signed-off-by: Haiyue Wang --- src/mctpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mctpd.c b/src/mctpd.c index ab61d99..cd2b527 100644 --- a/src/mctpd.c +++ b/src/mctpd.c @@ -3714,7 +3714,7 @@ static int method_net_learn_endpoint(sd_bus_message *call, void *data, struct ctx *ctx = net->ctx; dest_phys dest = { 0 }; mctp_eid_t eid = 0; - struct peer *peer; + struct peer *peer = NULL; int rc; mctp_eid_t ret_eid; uint8_t ret_ep_type, ret_medium_spec;