From 8e7321c82cf446579fe14c7c369a7779e43aeddf Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 10 Dec 2023 13:21:40 +0100 Subject: lib: Fix memleak when creating IPCP The irm_create_ipcp leaked the ipcp_info protobuf message. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/irm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib/irm.c') diff --git a/src/lib/irm.c b/src/lib/irm.c index ce646ae7..7b45319e 100644 --- a/src/lib/irm.c +++ b/src/lib/irm.c @@ -54,8 +54,12 @@ pid_t irm_create_ipcp(const char * name, msg.code = IRM_MSG_CODE__IRM_CREATE_IPCP; msg.ipcp_info = ipcp_info_s_to_msg(&info); + if (msg.ipcp_info == NULL) + return -ENOMEM; recv_msg = send_recv_irm_msg(&msg); + ipcp_info_msg__free_unpacked(msg.ipcp_info, NULL); + if (recv_msg == NULL) return -EIRMD; -- cgit v1.2.3