From 84a8cc46e142657c4a8fc93aab9306c70df96feb Mon Sep 17 00:00:00 2001 From: Michal Simon Date: Fri, 15 Dec 2017 14:26:38 +0100 Subject: [PATCH] [XrdPosix] Fix various memory related issues. --- src/XrdPosix/XrdPosixLinkage.cc | 2 +- src/XrdPosix/XrdPosixXrootd.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/XrdPosix/XrdPosixLinkage.cc b/src/XrdPosix/XrdPosixLinkage.cc index 12c15c83067..f7ca56d4823 100644 --- a/src/XrdPosix/XrdPosixLinkage.cc +++ b/src/XrdPosix/XrdPosixLinkage.cc @@ -301,7 +301,7 @@ void XrdPosixLinkage::Missing(const char *epname) if (epname) epList = new Missing(epList, epname); else {Missing *np = epList; while(np) cerr << "PosixPreload: Unable to resolve Unix '" - <What <<"()'" <Next; } } diff --git a/src/XrdPosix/XrdPosixXrootd.cc b/src/XrdPosix/XrdPosixXrootd.cc index 954ccfa3e50..7c49cdf775f 100644 --- a/src/XrdPosix/XrdPosixXrootd.cc +++ b/src/XrdPosix/XrdPosixXrootd.cc @@ -580,7 +580,7 @@ int XrdPosixXrootd::Open(const char *path, int oflags, mode_t mode, if (XrdPosixGlobals::myCache2) {int rc = XrdPosixGlobals::myCache2->Prepare(path, oflags, mode); if (rc > 0) return OpenDefer(fp, cbP, XOflags, XOmode, oflags&isStream); - if (rc < 0) {errno = -rc; return -1;} + if (rc < 0) {delete fp; errno = -rc; return -1;} } // Open the file (sync or async) @@ -1200,7 +1200,7 @@ int XrdPosixXrootd::Statvfs(const char *path, struct statvfs *buf) // Return what little we can // - memset(buf, 0, sizeof(struct statfs)); + memset(buf, 0, sizeof(struct statvfs)); buf->f_bsize = 1024*1024; buf->f_frsize = 1024*1024; buf->f_blocks = static_cast(rwBlks);