mirror of
https://github.com/wolfpld/tracy.git
synced 2026-09-04 01:18:29 +00:00
Free the tid buffer when thread enumeration yields nothing.
A task directory yielding no numeric entries (the target exiting mid-enumeration) returned 0 with the freshly allocated array still handed back through *out, and the caller's failure path returned without freeing it.
This commit is contained in:
@@ -457,6 +457,12 @@ static int EnumerateTaskTids( pid_t pid, uint32_t** out )
|
||||
tids[count++] = (uint32_t)tid;
|
||||
}
|
||||
closedir( dir );
|
||||
if( count == 0 )
|
||||
{
|
||||
tracy_free( tids );
|
||||
*out = nullptr;
|
||||
return 0;
|
||||
}
|
||||
*out = tids;
|
||||
return (int)count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user