]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
bugfix: allocate memory before copying the device name select_audio_io
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Sat, 4 Nov 2023 17:48:16 +0000 (23:18 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Sat, 4 Nov 2023 17:48:16 +0000 (23:18 +0530)
rx_menu.c

index 14bdc745074639b48242fea4a2fbbd81c7133e9f..938f3133d8218a9b63327bbbd565f9b6c50bb510 100644 (file)
--- 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