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,10 +395,17 @@ 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())
|
||||||
{
|
{
|
||||||
|
delete s;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
#if WXWIN_COMPATIBILITY_2_6
|
#if WXWIN_COMPATIBILITY_2_6
|
||||||
if (factory->IsKindOf(CLASSINFO(wxZipClassFactory)))
|
if (factory->IsKindOf(CLASSINFO(wxZipClassFactory)))
|
||||||
((wxZipInputStream*)s)->m_allowSeeking = true;
|
((wxZipInputStream*)s)->m_allowSeeking = true;
|
||||||
@@ -414,10 +421,6 @@ wxFSFile* wxArchiveFSHandler::OpenFile(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete s;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxString wxArchiveFSHandler::FindFirst(const wxString& spec, int flags)
|
wxString wxArchiveFSHandler::FindFirst(const wxString& spec, int flags)
|
||||||
{
|
{
|
||||||
wxString right = GetRightLocation(spec);
|
wxString right = GetRightLocation(spec);
|
||||||
|
Reference in New Issue
Block a user