Fix memory leak in case of error in wxOSX graphics code.
Delete the pointer before returning from the function if we don't pass its ownership to CGDataProviderCreateWithData(). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75955 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2977,7 +2977,10 @@ CGDataProviderRef wxMacCGDataProviderCreateWithMemoryBuffer( const wxMemoryBuffe
|
||||
{
|
||||
wxMemoryBuffer* b = new wxMemoryBuffer( buf );
|
||||
if ( b->GetDataLen() == 0 )
|
||||
{
|
||||
delete b;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return CGDataProviderCreateWithData( b , (const void *) b->GetData() , b->GetDataLen() ,
|
||||
wxMacReleaseMemoryBufferProviderCallback );
|
||||
|
Reference in New Issue
Block a user