From e5d20e1377695083a96f1b20ba115bb98957434e Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 30 Aug 2026 16:30:26 +0200 Subject: [PATCH] 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. --- public/client/TracySysTrace.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/client/TracySysTrace.cpp b/public/client/TracySysTrace.cpp index 583d2cbb..3e18adb8 100644 --- a/public/client/TracySysTrace.cpp +++ b/public/client/TracySysTrace.cpp @@ -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; }