[PATCH 11/16] om: Fix memory leak on get_font_name error path.

Ander Conselvan de Oliveira ander.conselvan-de-oliveira at nokia.com
Wed Mar 30 06:12:04 PDT 2011


Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>
---
 modules/om/generic/omGeneric.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/modules/om/generic/omGeneric.c b/modules/om/generic/omGeneric.c
index 0029093..ec2abc0 100644
--- a/modules/om/generic/omGeneric.c
+++ b/modules/om/generic/omGeneric.c
@@ -574,8 +574,10 @@ get_rotate_fontname(
 	}
     }
 
-    if(field_num < CHARSET_ENCODING_FIELD)
+    if(field_num < CHARSET_ENCODING_FIELD) {
+	Xfree(pattern);
 	return NULL;
+    }
 
     /* Pixel Size field : fields[6] */
     for(ptr = fields[PIXEL_SIZE_FIELD - 1] ; ptr && *ptr; ptr++) {
-- 
1.7.0.4



More information about the xorg-devel mailing list