Fixes for cppcheck reported issues
This commit is contained in:
@@ -39,17 +39,6 @@ int __gl_memInit( size_t /*maxFast*/ )
|
||||
{
|
||||
#ifndef NO_MALLOPT
|
||||
/* mallopt( M_MXFAST, maxFast );*/
|
||||
#ifdef MEMORY_DEBUG
|
||||
mallopt( M_DEBUG, 1 );
|
||||
#endif
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef MEMORY_DEBUG
|
||||
void *__gl_memAlloc( size_t n )
|
||||
{
|
||||
return memset( malloc( n ), 0xa5, n );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -41,14 +41,8 @@
|
||||
#define memFree free
|
||||
|
||||
#define memInit __gl_memInit
|
||||
/*extern void __gl_memInit( size_t );*/
|
||||
extern int __gl_memInit( size_t );
|
||||
|
||||
#ifndef MEMORY_DEBUG
|
||||
#define memAlloc malloc
|
||||
#else
|
||||
#define memAlloc __gl_memAlloc
|
||||
extern void * __gl_memAlloc( size_t );
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -709,7 +709,12 @@ osg::ref_ptr<osg::Image> InputStream::readImage(bool readFromExternal)
|
||||
char* data = new char[size];
|
||||
if ( !data )
|
||||
throwException( "InputStream::readImage() Out of memory." );
|
||||
if ( getException() ) return NULL;
|
||||
|
||||
if ( getException() )
|
||||
{
|
||||
delete [] data;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
readCharArray( data, size );
|
||||
image = new osg::Image;
|
||||
|
||||
Reference in New Issue
Block a user