mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 11:57:32 +09:00
Prevent the existance of dangling pointers upon failure of FindDataStart.
This commit is contained in:
parent
89ad46ab66
commit
27ea0aaf55
1 changed files with 2 additions and 1 deletions
|
|
@ -217,16 +217,17 @@ nsresult nsZipHandle::Init(nsIFile *file, nsZipHandle **ret,
|
|||
#else
|
||||
handle->mNSPRFileDesc = fd.forget();
|
||||
#endif
|
||||
handle->mMap = map;
|
||||
handle->mFile.Init(file);
|
||||
handle->mTotalLen = (uint32_t) size;
|
||||
handle->mFileStart = buf;
|
||||
rv = handle->findDataStart();
|
||||
if (NS_FAILED(rv)) {
|
||||
PR_MemUnmap(buf, (uint32_t) size);
|
||||
handle->mFileStart = nullptr;
|
||||
PR_CloseFileMap(map);
|
||||
return rv;
|
||||
}
|
||||
handle->mMap = map;
|
||||
handle.forget(ret);
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue