Skip to content

Commit

Permalink
XrdCl: Delete URL pointer if it was previously allocated to avoid lea…
Browse files Browse the repository at this point in the history
…k in case

       the same file object is used in a loop to open and close files.
  • Loading branch information
esindril authored and ljanyst committed Apr 16, 2015
1 parent 710deb9 commit fbf7cd5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/XrdCl/XrdClFileStateHandler.cc
Expand Up @@ -305,6 +305,13 @@ namespace XrdCl
// Check if the parameters are valid
//--------------------------------------------------------------------------
Log *log = DefaultEnv::GetLog();

if (pFileUrl)
{
delete pFileUrl;
pFileUrl = 0;
}

pFileUrl = new URL( url );
if( !pFileUrl->IsValid() )
{
Expand Down

0 comments on commit fbf7cd5

Please sign in to comment.