Skip to content

Commit

Permalink
[Secsss] Fix mismatched new/free in XrdSecsssID::~XrdSecsssID()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
amadio committed Nov 26, 2024
1 parent 02f5083 commit c3b458a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/XrdSecsss/XrdSecsssID.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit c3b458a

Please sign in to comment.