mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Avoid leaking memory in an error path. Noticed
by cppcheck. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73187 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fa3f80a2b7
commit
861d20aab4
@ -167,10 +167,11 @@ Archive::addFileBefore(const sys::Path& filePath, iterator where,
|
||||
mbr->data = 0;
|
||||
mbr->path = filePath;
|
||||
const sys::FileStatus *FSInfo = mbr->path.getFileStatus(false, ErrMsg);
|
||||
if (FSInfo)
|
||||
mbr->info = *FSInfo;
|
||||
else
|
||||
if (!FSInfo) {
|
||||
delete mbr;
|
||||
return true;
|
||||
}
|
||||
mbr->info = *FSInfo;
|
||||
|
||||
unsigned flags = 0;
|
||||
bool hasSlash = filePath.toString().find('/') != std::string::npos;
|
||||
|
Loading…
x
Reference in New Issue
Block a user