Skip to content

Commit 890f81d

Browse files
committed
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 <haiyuewa@163.com>
1 parent 0340102 commit 890f81d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/mctpd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3714,7 +3714,7 @@ static int method_net_learn_endpoint(sd_bus_message *call, void *data,
37143714
struct ctx *ctx = net->ctx;
37153715
dest_phys dest = { 0 };
37163716
mctp_eid_t eid = 0;
3717-
struct peer *peer;
3717+
struct peer *peer = NULL;
37183718
int rc;
37193719
mctp_eid_t ret_eid;
37203720
uint8_t ret_ep_type, ret_medium_spec;

0 commit comments

Comments
 (0)