check that the pointer is non-NULL before using it in OpenFile() (thanks coverity)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45138 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -395,27 +395,30 @@ wxFSFile* wxArchiveFSHandler::OpenFile(
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxArchiveInputStream *s = factory->NewStream(leftStream);
|
wxArchiveInputStream *s = factory->NewStream(leftStream);
|
||||||
|
if ( !s )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
s->OpenEntry(*entry);
|
s->OpenEntry(*entry);
|
||||||
|
|
||||||
if (s && s->IsOk())
|
if (!s->IsOk())
|
||||||
{
|
{
|
||||||
#if WXWIN_COMPATIBILITY_2_6
|
delete s;
|
||||||
if (factory->IsKindOf(CLASSINFO(wxZipClassFactory)))
|
return NULL;
|
||||||
((wxZipInputStream*)s)->m_allowSeeking = true;
|
|
||||||
#endif // WXWIN_COMPATIBILITY_2_6
|
|
||||||
|
|
||||||
return new wxFSFile(s,
|
|
||||||
key + right,
|
|
||||||
GetMimeTypeFromExt(location),
|
|
||||||
GetAnchor(location)
|
|
||||||
#if wxUSE_DATETIME
|
|
||||||
, entry->GetDateTime()
|
|
||||||
#endif // wxUSE_DATETIME
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete s;
|
#if WXWIN_COMPATIBILITY_2_6
|
||||||
return NULL;
|
if (factory->IsKindOf(CLASSINFO(wxZipClassFactory)))
|
||||||
|
((wxZipInputStream*)s)->m_allowSeeking = true;
|
||||||
|
#endif // WXWIN_COMPATIBILITY_2_6
|
||||||
|
|
||||||
|
return new wxFSFile(s,
|
||||||
|
key + right,
|
||||||
|
GetMimeTypeFromExt(location),
|
||||||
|
GetAnchor(location)
|
||||||
|
#if wxUSE_DATETIME
|
||||||
|
, entry->GetDateTime()
|
||||||
|
#endif // wxUSE_DATETIME
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxArchiveFSHandler::FindFirst(const wxString& spec, int flags)
|
wxString wxArchiveFSHandler::FindFirst(const wxString& spec, int flags)
|
||||||
|
Reference in New Issue
Block a user