From e3391e8d160f4b1b43d53b4a7d462a3601c45408 Mon Sep 17 00:00:00 2001
From: akallabeth <akallabeth@posteo.net>
Date: Sat, 10 Jan 2026 08:36:38 +0100
Subject: [PATCH] free up old audio formats

CVE: CVE-2026-22852
Upstream-Status: Backport [https://github.com/FreeRDP/FreeRDP/commit/cd1ffa112cfbe1b40a9fd57e299a8ea12e23df0d]
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
 channels/audin/client/audin_main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/channels/audin/client/audin_main.c b/channels/audin/client/audin_main.c
index 23561b153..5ffe09127 100644
--- a/channels/audin/client/audin_main.c
+++ b/channels/audin/client/audin_main.c
@@ -219,6 +219,10 @@ static UINT audin_process_formats(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLBACK* c
 	}
 
 	Stream_Seek_UINT32(s); /* cbSizeFormatsPacket */
+
+	audio_formats_free(callback->formats, callback->formats_count);
+	callback->formats_count = 0;
+
 	callback->formats = audio_formats_new(NumFormats);
 
 	if (!callback->formats)
