Commit b4e858a8 authored by Elvin Sindrilaru's avatar Elvin Sindrilaru
Browse files

XROOTD: Fix variable name typo and free memory allocated in the mover for the error message

parent 46a1ebde
......@@ -533,7 +533,7 @@ XrdxCastor2OfsFile::close()
}
int errc = (rc ? error.getErrInfo() : rc);
char* errmsg = (rc ? (char*)error.getErrText() : (char*)0);
char* errmsg = (rc ? strdup(error.getErrText()) : (char*)0);
xcastor_info("send diskmgr errc=%i, errmsg=%s", errc, (errmsg ? errmsg : ""));
int dm_errno = mover_close_file(mDiskMgrPort, mReqId.c_str(), sz_file,
const_cast<const char*>(ckSumalg),
......@@ -543,9 +543,12 @@ XrdxCastor2OfsFile::close()
// If failed to commit to diskmanager then return error
if (dm_errno)
{
xcastor_err("path=%s failed closing file: %s", newpath.c_str(), errormsg);
xcastor_err("path=%s failed closing file: %s", newpath.c_str(), errmsg);
rc = gSrv->Emsg("close", error, dm_errno, "send status to diskmanager");
}
// Free errmsg memory
free(errmsg);
}
if (gSrv->mLogLevel == LOG_DEBUG)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment