Skip to content

Commit

Permalink
Merge pull request #275 from alja/posixResValgrind
Browse files Browse the repository at this point in the history
Fix valgrind report in XrdPosixMap::Result()
  • Loading branch information
abh3 committed Aug 14, 2015
2 parents e5d1c01 + f084a14 commit 26f7ece
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/XrdPosix/XrdPosixMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ XrdCl::Access::Mode XrdPosixMap::Mode2Access(mode_t mode)

int XrdPosixMap::Result(const XrdCl::XRootDStatus &Status)
{
const char *eText;
std::string eText;
int eNum;

// If all went well, return success
Expand All @@ -170,16 +170,16 @@ int XrdPosixMap::Result(const XrdCl::XRootDStatus &Status)
// If this is an xrootd error then get the xrootd generated error
//
if (Status.code == XrdCl::errErrorResponse)
{eText = Status.GetErrorMessage().c_str();
{eText = Status.GetErrorMessage();
eNum = mapError(Status.errNo);
} else {
eText = Status.ToStr().c_str();
eText = Status.ToStr();
eNum = (Status.errNo ? Status.errNo : mapCode(Status.code));
}

// Trace this if need be
//
if (eNum != ENOENT && eText && *eText && Debug)
if (eNum != ENOENT && !eText.empty() && Debug)
cerr <<"XrdPosix: " <<eText <<endl;

// Return
Expand Down

0 comments on commit 26f7ece

Please sign in to comment.