From c3b458a5d17d38a01861a5fa556ca2146d2a30cb Mon Sep 17 00:00:00 2001 From: Guilherme Amadio Date: Tue, 26 Nov 2024 11:45:05 +0100 Subject: [PATCH] [Secsss] Fix mismatched new/free in XrdSecsssID::~XrdSecsssID() The defaultID is created with defaultID = new XrdSecsssEnt(...); so it cannot be deallocated with free(defaultID). Since the destructor is private, we cannot call delete defaultID either. We must call the specific function for this, which is defaultID->Delete(), which in turn will call delete instead of free to deallocate the memory. --- src/XrdSecsss/XrdSecsssID.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/XrdSecsss/XrdSecsssID.cc b/src/XrdSecsss/XrdSecsssID.cc index 7616211bf57..b5f2e6708af 100644 --- a/src/XrdSecsss/XrdSecsssID.cc +++ b/src/XrdSecsss/XrdSecsssID.cc @@ -132,7 +132,7 @@ XrdSecsssID::XrdSecsssID(authType aType, const XrdSecEntity *idP, /* Private: D e s t r u c t o r */ /******************************************************************************/ -XrdSecsssID::~XrdSecsssID() {if (defaultID) free(defaultID);} +XrdSecsssID::~XrdSecsssID() {if (defaultID) defaultID->Delete();} /******************************************************************************/ /* Private: F i n d */