diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2023-12-10 13:21:40 +0100 |
---|---|---|
committer | Sander Vrijders <sander@ouroboros.rocks> | 2023-12-17 13:23:49 +0100 |
commit | 8e7321c82cf446579fe14c7c369a7779e43aeddf (patch) | |
tree | b97c9b38c1e31cd7531d878d69f50e761bd51be8 | |
parent | fbb9eae2c791845756e0dd9136d7becf8da03608 (diff) | |
download | ouroboros-8e7321c82cf446579fe14c7c369a7779e43aeddf.tar.gz ouroboros-8e7321c82cf446579fe14c7c369a7779e43aeddf.zip |
lib: Fix memleak when creating IPCP
The irm_create_ipcp leaked the ipcp_info protobuf message.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
-rw-r--r-- | src/lib/irm.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; |