diff options
author | wm4 <wm4@nowhere> | 2015-10-30 15:51:26 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-10-30 15:51:26 +0100 |
commit | 05e39ec51362d9c23f0652a4ac5017a1b6489e49 (patch) | |
tree | 0e3766c65f5e698a3cb4496f9822e034de67f3ff /stream/ai_oss.c | |
parent | 7aba3a5d96b0d3b22c9e93057b6d1b4cba0e5104 (diff) | |
download | mpv-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_oss.c')
-rw-r--r-- | stream/ai_oss.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/stream/ai_oss.c b/stream/ai_oss.c index 0362f207dc..d1ef701e6e 100644 --- a/stream/ai_oss.c +++ b/stream/ai_oss.c @@ -87,11 +87,14 @@ int ai_oss_init(audio_in_t *ai) int err; int ioctl_param; - ai->oss.audio_fd = open(ai->oss.device, O_RDONLY | O_CLOEXEC); + const char *device = ai->oss.device; + if (!device) + device = "/dev/dsp"; + + ai->oss.audio_fd = open(device, O_RDONLY | O_CLOEXEC); if (ai->oss.audio_fd < 0) { - MP_ERR(ai, "Unable to open '%s': %s\n", - ai->oss.device, mp_strerror(errno)); + MP_ERR(ai, "Unable to open '%s': %s\n", device, mp_strerror(errno)); return -1; } |