Commit 424cbdea authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

VlmcLogger: Check asprintf return

parent 849dbe07
......@@ -183,8 +183,10 @@ VlmcLogger::backendLogHandler(void *data, Backend::IBackend::LogLevel logLevel,
{
VlmcLogger* self = reinterpret_cast<VlmcLogger*>( data );
char* newMsg = NULL;
asprintf( &newMsg, "[%s] T #%p [Backend] %s", qPrintable( QTime::currentTime().toString( "hh:mm:ss.zzz" ) ),
QThread::currentThreadId(), msg );
if ( asprintf( &newMsg, "[%s] T #%p [Backend] %s", qPrintable( QTime::currentTime().toString( "hh:mm:ss.zzz" ) ),
QThread::currentThreadId(), msg ) < 0 )
return ;
if ( self->m_logFile != NULL )
self->writeToFile( newMsg );
if ( logLevel < self->m_backendLogLevel )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment