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 committed Dec 12, 2014
1 parent 7cfaedd commit 1030ed3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/XrdCl/XrdClFileStateHandler.cc
Original file line number Diff line number Diff line change
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 1030ed3

Please sign in to comment.