Skip to content

Commit

Permalink
Add virtual default DTOR to ClientEvent::Base
Browse files Browse the repository at this point in the history
ClientEvent::Base is the base class for many other classes including
a few that add data members. If at some point one of these enhanced
derived classes is referenced and then deleted via a base class
pointer, some memory could leak.

I don't think we do that yet, but it seems worth preventing.

Signed-off-by: Charlie Vigue <charlie.vigue@openvpn.com>
  • Loading branch information
cvigue authored and dsommers committed Jan 24, 2024
1 parent b06252b commit 9f3d32b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions openvpn/client/clievent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class Base : public RC<thread_safe_refcount>
{
public:
typedef RCPtr<Base> Ptr;
virtual ~Base() = default;
Base(Type id)
: id_(id)
{
Expand Down

0 comments on commit 9f3d32b

Please sign in to comment.