From 7950c77332168d79b20d3f8cbfefb9ca2fa43c45 Mon Sep 17 00:00:00 2001 From: Markus Wick Date: Sat, 15 Aug 2015 20:52:12 +0200 Subject: [PATCH] Merge pull request #2854 from Tilka/valgrind Fix some small stuff found with Valgrind Conflicts: Source/Core/Core/PowerPC/CachedInterpreter.cpp --- Source/Core/AudioCommon/PulseAudioStream.cpp | 3 ++- Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Core/AudioCommon/PulseAudioStream.cpp b/Source/Core/AudioCommon/PulseAudioStream.cpp index 1932ed031a..d70b046cd0 100644 --- a/Source/Core/AudioCommon/PulseAudioStream.cpp +++ b/Source/Core/AudioCommon/PulseAudioStream.cpp @@ -163,7 +163,8 @@ void PulseAudio::StateCallback(pa_context* c) void PulseAudio::UnderflowCallback(pa_stream* s) { m_pa_ba.tlength += BUFFER_SAMPLES * m_channels * m_bytespersample; - pa_stream_set_buffer_attr(s, &m_pa_ba, nullptr, nullptr); + pa_operation* op = pa_stream_set_buffer_attr(s, &m_pa_ba, nullptr, nullptr); + pa_operation_unref(op); WARN_LOG(AUDIO, "pulseaudio underflow, new latency: %d bytes", m_pa_ba.tlength); } diff --git a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp index 6ee55ba0e5..7f4f9d21c1 100644 --- a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp +++ b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp @@ -41,7 +41,7 @@ void Init(std::vector &controllerDevices) const char* devnode = udev_device_get_devnode(dev); // We only care about devices which we have read/write access to. - if (access(devnode, W_OK) == 0) + if (devnode && access(devnode, W_OK) == 0) { // Unfortunately udev gives us no way to filter out the non event device interfaces. // So we open it and see if it works with evdev ioctls or not.