fix a minor memory leak
authorLennart Poettering <lennart@poettering.net>
Tue, 27 May 2008 22:04:09 +0000 (22:04 +0000)
committerLennart Poettering <lennart@poettering.net>
Tue, 27 May 2008 22:04:09 +0000 (22:04 +0000)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2486 fefdeb5f-60dc-0310-8127-8f9354f1896f

src/pulse/context.c

index 2d92320..07c3f3d 100644 (file)
@@ -752,11 +752,15 @@ static char *get_legacy_runtime_dir(void) {
 
     p = pa_sprintf_malloc("/tmp/pulse-%s", u);
 
-    if (stat(p, &st) < 0)
+    if (stat(p, &st) < 0) {
+        pa_xfree(p);
         return NULL;
+    }
 
-    if (st.st_uid != getuid())
+    if (st.st_uid != getuid()) {
+        pa_xfree(p);
         return NULL;
+    }
 
     return p;
 }