[hw/xfree86 7/7] hw/xfree86/os-support/bus/Sbus.c: Fix leaks

Niels Thykier niels at thykier.net
Fri Nov 2 02:41:53 PDT 2012


Signed-off-by: Niels Thykier <niels at thykier.net>
---
 hw/xfree86/os-support/bus/Sbus.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/hw/xfree86/os-support/bus/Sbus.c b/hw/xfree86/os-support/bus/Sbus.c
index 8260007..14e6d4b 100644
--- a/hw/xfree86/os-support/bus/Sbus.c
+++ b/hw/xfree86/os-support/bus/Sbus.c
@@ -617,8 +617,10 @@ sparcPromPathname2Node(const char *pathName)
         return 0;
     strcpy(name, pathName);
     name[i + 1] = 0;
-    if (name[0] != '/')
+    if (name[0] != '/') {
+        free(name);
         return 0;
+    }
     p = strchr(name + 1, '/');
     if (p)
         *p = 0;
@@ -629,8 +631,10 @@ sparcPromPathname2Node(const char *pathName)
         *regstr++ = 0;
     else
         regstr = p;
-    if (name + 1 == regstr)
+    if (name + 1 == regstr) {
+        free(name);
         return 0;
+    }
     promGetSibling(0);
     i = promWalkPathname2Node(name + 1, regstr, promRootNode, 0);
     free(name);
-- 
1.7.10.4



More information about the xorg-devel mailing list