[Openvpn-devel,v2] manage: free ext_cert_input in man_connection_close()

Message ID 20261123135003.31908-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v2] manage: free ext_cert_input in man_connection_close() |

Commit Message

Gert Doering Nov. 23, 2026, 1:49 p.m. UTC
  From: Razvan Cojocaru <razvanc@mailbox.org>

ext_key_input was freed there, its certificate counterpart was not.
While here, pass mc to in_extra_reset() like the rest of the function.

Change-Id: I48d315a38a653aed4b33d3277433cb8a6596942d
Signed-off-by: Razvan Cojocaru <razvanc@mailbox.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2237
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2237
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <frank@lichtenheld.com>
  

Comments

Gert Doering Nov. 23, 2026, 6:17 p.m. UTC | #1
Memleak, even if minor and only for a special case, but still - and
so it goes to 2.7.

Tested 2.7 via GHA.

Your patch has been applied to the master and release/2.7 branch.

commit 2f921ab3b4b80c2ff1b2ff3daf41ff206f499bdd (master)
Author: Razvan Cojocaru
Date:   Mon Nov 23 14:49:58 2026 +0100

     manage: free ext_cert_input in man_connection_close()

     Signed-off-by: Razvan Cojocaru <razvanc@mailbox.org>
     Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2237
     Message-Id: <20261123135003.31908-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg41824.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering
  

Patch

diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c
index 86c498e..a5b635d 100644
--- a/src/openvpn/manage.c
+++ b/src/openvpn/manage.c
@@ -2860,8 +2860,9 @@ 
 
     event_timeout_clear(&mc->bytecount_update_interval);
 
-    in_extra_reset(&man->connection, IER_RESET);
+    in_extra_reset(mc, IER_RESET);
     buffer_list_free(mc->ext_key_input);
+    buffer_list_free(mc->ext_cert_input);
     man_connection_clear(mc);
 }