[PATCH 02/11] mi: fix memory leak in miInitVisuals

Tiago Vignatti tiago.vignatti at nokia.com
Fri Mar 25 11:41:44 PDT 2011


Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
---
 mi/micmap.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/mi/micmap.c b/mi/micmap.c
index 41e0300..7448ef8 100644
--- a/mi/micmap.c
+++ b/mi/micmap.c
@@ -564,6 +564,8 @@ miInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
 	{
 	    vid = malloc(nvtype * sizeof (VisualID));
 	    if (!vid) {
+	        free(depth);
+	        free(visual);
 		free(preferredCVCs);
 		return FALSE;
 	    }
-- 
1.7.0.4



More information about the xorg-devel mailing list