pulsecore: Fixed possible memory leak
authorDeepak Srivastava <srivastava.d@samsung.com>
Fri, 6 May 2016 04:44:46 +0000 (10:14 +0530)
committerArun Raghavan <git@arunraghavan.net>
Fri, 6 May 2016 05:39:17 +0000 (11:09 +0530)
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=95291
Signed-off-by: Deepak Srivastava <srivastava.d@samsung.com>
Signed-off-by: Arun Raghavan <git@arunraghavan.net>
src/pulsecore/core-util.c

index 19c89a9..b6eb85a 100644 (file)
@@ -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;