Skip to content

Commit

Permalink
[Server] Prevent double unlock when open fails post file object creat…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
abh3 committed Mar 14, 2018
1 parent 453f2c5 commit 2c27fbb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/XrdXrootd/XrdXrootdXeq.cc
Expand Up @@ -1193,12 +1193,14 @@ struct OpenHelper
: fp(0), xp(0), Locker(lkP), path(fn), mode(0),
isOK(false) {}

~OpenHelper() {if (!isOK)
{if (xp) delete xp;
else if (fp) delete fp;
~OpenHelper()
{if (!isOK)
{if (xp) delete xp; // Deletes fp & unlocks
else {if (fp) delete fp;
if (mode) Locker->Unlock(path,mode);
}
}
}
}
};
}

Expand Down

0 comments on commit 2c27fbb

Please sign in to comment.