From 1ba053070465e2483ef08fba8229493bd59d945c Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan <ram@rkrishnan.org>
Date: Sat, 4 Nov 2023 23:18:16 +0530
Subject: [PATCH] bugfix: allocate memory before copying the device name

---
 rx_menu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rx_menu.c b/rx_menu.c
index 14bdc74..938f313 100644
--- a/rx_menu.c
+++ b/rx_menu.c
@@ -202,6 +202,7 @@ void toggle_audio_output_device(void) {
     }
 
     char *new_output_device_name = output_devices[out_index].name;
+    active_receiver->audio_name = g_new(gchar, strlen(new_output_device_name) + 1);
     strcpy(active_receiver->audio_name, new_output_device_name);
 
     // set the other device as active
-- 
2.45.2