Skip to content

Commit d4e40b7

Browse files
theanalystesindril
authored andcommitted
OFS: Fix use of ConfigFN everywhere
These are allocated via strdup but never freed
1 parent eee15ee commit d4e40b7

4 files changed

Lines changed: 20 additions & 0 deletions

File tree

auth_plugin/EosAuthOfs.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ EosAuthOfs::~EosAuthOfs()
168168
delete mFrontend;
169169
delete mBackend.second;
170170
delete mZmqContext;
171+
// Free configuration file name allocated via strdup during initialization
172+
if (ConfigFN) {
173+
free(ConfigFN);
174+
ConfigFN = nullptr;
175+
}
171176
}
172177

173178

fst/XrdFstOfs.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,11 @@ XrdFstOfs::~XrdFstOfs()
468468
if (mHostName) {
469469
free(const_cast<char*>(mHostName));
470470
}
471+
// Free configuration file name allocated via strdup during initialization
472+
if (ConfigFN) {
473+
free(ConfigFN);
474+
ConfigFN = nullptr;
475+
}
471476
}
472477

473478
//------------------------------------------------------------------------------

mgm/XrdMgmOfs.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,12 @@ XrdMgmOfs::~XrdMgmOfs()
389389
if (HostName) {
390390
free(HostName);
391391
}
392+
if (HostPref) {
393+
free(HostPref);
394+
}
395+
if (ConfigFN) {
396+
free(ConfigFN);
397+
}
392398
}
393399

394400
//------------------------------------------------------------------------------

mq/XrdMqOfs.hh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ public:
313313
if (HostPref) {
314314
free(HostPref);
315315
}
316+
317+
if (ConfigFN) {
318+
free(ConfigFN);
319+
}
316320
}
317321

318322
virtual bool Init(XrdSysError&)

0 commit comments

Comments
 (0)