From 05e39ec51362d9c23f0652a4ac5017a1b6489e49 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 30 Oct 2015 15:51:26 +0100 Subject: 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. --- stream/ai_oss.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'stream/ai_oss.c') 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; } -- cgit v1.2.3