projects
/
pihpsdr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aa372f1
)
rx_menu: fix memory leak introduced in 1ba053070
author
Ramakrishnan Muthukrishnan
<ram@rkrishnan.org>
Sun, 5 Nov 2023 14:23:04 +0000
(19:53 +0530)
committer
Ramakrishnan Muthukrishnan
<ram@rkrishnan.org>
Sun, 5 Nov 2023 14:23:04 +0000
(19:53 +0530)
rx_menu.c
patch
|
blob
|
history
diff --git
a/rx_menu.c
b/rx_menu.c
index 938f3133d8218a9b63327bbbd565f9b6c50bb510..b6d0c870fb99ababab8c8a16556681ea1746945b 100644
(file)
--- a/
rx_menu.c
+++ b/
rx_menu.c
@@
-201,6
+201,12
@@
void toggle_audio_output_device(void) {
audio_close_output(active_receiver);
}
+ // deallocate memory for the name of the previous device.
+ if (active_receiver->audio_name != NULL) {
+ g_free(active_receiver->audio_name);
+ active_receiver->audio_name = NULL;
+ }
+
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);