diff options
author | Dan Glastonbury <[email protected]> | 2017-09-29 07:58:51 +1000 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2017-09-29 11:11:58 +1300 |
commit | d6ae2ed9c5d1c0f7d0fb7bdcf70bf75c5464f689 (patch) | |
tree | 1d98c688bd9b16d8f909d223a5d013e3622a9986 /src/cubeb_pulse.c | |
parent | 69b9bc88246d4d5280f9ec702e4f5150c06eb358 (diff) | |
download | cubeb-d6ae2ed9c5d1c0f7d0fb7bdcf70bf75c5464f689.tar.gz cubeb-d6ae2ed9c5d1c0f7d0fb7bdcf70bf75c5464f689.zip |
pulse: Cleanup potentionally dangling pointers.
Set default_sink_name and default_source_name to a valid string
pointer or NULL after free'ing previous values.
Diffstat (limited to 'src/cubeb_pulse.c')
-rw-r--r-- | src/cubeb_pulse.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cubeb_pulse.c b/src/cubeb_pulse.c index 07a1717..73307cd 100644 --- a/src/cubeb_pulse.c +++ b/src/cubeb_pulse.c @@ -1370,10 +1370,10 @@ pulse_server_info_cb(pa_context * c, const pa_server_info * i, void * userdata) free(list_data->default_sink_name); free(list_data->default_source_name); - if (i->default_sink_name) - list_data->default_sink_name = strdup(i->default_sink_name); - if (i->default_source_name) - list_data->default_source_name = strdup(i->default_source_name); + list_data->default_sink_name = + i->default_sink_name ? strdup(i->default_sink_name) : NULL; + list_data->default_source_name = + i->default_source_name ? strdup(i->default_source_name) : NULL; WRAP(pa_threaded_mainloop_signal)(list_data->context->mainloop, 0); } |