Skip to content

Commit

Permalink
Merge pull request #927 from sacereda/systrace-leak
Browse files Browse the repository at this point in the history
Leak, returned value from GetThreadDescription not freed
  • Loading branch information
wolfpld authored Nov 19, 2024
2 parents e756fa7 + b9ee0d3 commit 759b4c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions public/client/TracySysTrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,11 @@ void SysTraceGetExternalName( uint64_t thread, const char*& threadName, const ch
if( _GetThreadDescription )
{
PWSTR tmp;
_GetThreadDescription( hnd, &tmp );
char buf[256];
if( tmp )
if ( SUCCEEDED( _GetThreadDescription( hnd, &tmp ) ) )
{
char buf[256];
auto ret = wcstombs( buf, tmp, 256 );
LocalFree(tmp);
if( ret != 0 )
{
threadName = CopyString( buf, ret );
Expand Down

0 comments on commit 759b4c3

Please sign in to comment.