summaryrefslogtreecommitdiffstats
path: root/stream/ai_sndio.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-10-30 15:51:26 +0100
committerwm4 <wm4@nowhere>2015-10-30 15:51:26 +0100
commit05e39ec51362d9c23f0652a4ac5017a1b6489e49 (patch)
tree0e3766c65f5e698a3cb4496f9822e034de67f3ff /stream/ai_sndio.c
parent7aba3a5d96b0d3b22c9e93057b6d1b4cba0e5104 (diff)
downloadmpv-05e39ec51362d9c23f0652a4ac5017a1b6489e49.tar.bz2
mpv-05e39ec51362d9c23f0652a4ac5017a1b6489e49.tar.xz
stream/audio: fix unchecked strdups
See #2435. It's literally a waste of time trying to fix minor memory leaks in this old, unused, and crappy code.
Diffstat (limited to 'stream/ai_sndio.c')
-rw-r--r--stream/ai_sndio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/stream/ai_sndio.c b/stream/ai_sndio.c
index 2bb47955a4..10e95cea62 100644
--- a/stream/ai_sndio.c
+++ b/stream/ai_sndio.c
@@ -38,7 +38,10 @@ int ai_sndio_init(audio_in_t *ai)
{
int err;
- if ((ai->sndio.hdl = sio_open(ai->sndio.device, SIO_REC, 0)) == NULL) {
+ const char *device = ai->sndio.device;
+ if (!device)
+ device = "default";
+ if ((ai->sndio.hdl = sio_open(device, SIO_REC, 0)) == NULL) {
MP_ERR(ai, "could not open sndio audio");
return -1;
}