[PATCH 1/4] Coverity: dix/resource.c: leaked_storage: Variable "funcs" goes out of scope

Oliver McFadden oliver.mcfadden at nokia.com
Mon Dec 28 02:02:55 PST 2009


Signed-off-by: Oliver McFadden <oliver.mcfadden at nokia.com>
---
 dix/resource.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dix/resource.c b/dix/resource.c
index 91d0cfb..71774d1 100644
--- a/dix/resource.c
+++ b/dix/resource.c
@@ -209,7 +209,10 @@ CreateNewResourceType(DeleteType deleteFunc, char *name)
     if (!funcs)
 	return 0;
     if (!dixRegisterPrivateOffset(next, -1))
+    {
+	xfree (funcs);
 	return 0;
+    }
 
     lastResourceType = next;
     DeleteFuncs = funcs;
-- 
1.6.1



More information about the xorg-devel mailing list