Fix use-after-free: delete temp file before freeing path memory

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Mikhail Kilin
2026-02-18 17:26:07 +03:00
parent 01bf41c61c
commit 420841ee30

View File

@@ -99,8 +99,8 @@ fn handleTranscription(
var audio_path = tmp_input;
var tmp_audio: ?[]u8 = null;
defer if (tmp_audio) |p| {
allocator.free(p);
std.fs.deleteFileAbsolute(p) catch {};
allocator.free(p);
};
if (is_video) {