[PATCH 10/32] [libx11] Variable "missing_list" goes out of scope

Erkki Seppälä erkki.seppala at vincit.fi
Wed Jan 26 23:53:53 PST 2011


Fixed memory leak by adding Xfree and initializing missing_list with NULL

Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>
Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>
---
 modules/im/ximcp/imRmAttr.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/modules/im/ximcp/imRmAttr.c b/modules/im/ximcp/imRmAttr.c
index d62dfdb..ae053c9 100644
--- a/modules/im/ximcp/imRmAttr.c
+++ b/modules/im/ximcp/imRmAttr.c
@@ -313,7 +313,7 @@ _XimAttributeToValue(
 	    INT16	 len = data[0];
 	    char	*base_name;
 	    XFontSet	 rep = (XFontSet)NULL;
-	    char	**missing_list;
+	    char	**missing_list = NULL;
 	    int		 missing_count;
 	    char	*def_string;
 
@@ -347,6 +347,7 @@ _XimAttributeToValue(
 	    }
 
 	    Xfree(base_name);
+	    Xfree(missing_list);
 	    *((XFontSet *)value) = rep;
 	    break;
 	}
-- 
1.7.0.4



More information about the xorg-devel mailing list