[pulseaudio-discuss] [PATCH] pulsecore: Fixed possible memory leak

Deepak Srivastava srivastava.d at samsung.com
Fri May 6 04:44:46 UTC 2016


BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=95291

Signed-off-by: Deepak Srivastava <srivastava.d at samsung.com>
---
 src/pulsecore/core-util.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 19c89a9..b6eb85a 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -2535,8 +2535,10 @@ char *pa_getcwd(void) {
         if (getcwd(p, l))
             return p;
 
-        if (errno != ERANGE)
+        if (errno != ERANGE) {
+            pa_xfree(p);
             return NULL;
+        }
 
         pa_xfree(p);
         l *= 2;
-- 
1.9.1



More information about the pulseaudio-discuss mailing list