From 9fa1e98dd7c3481f8e1a0d31037c01c5b02440fc Mon Sep 17 00:00:00 2001 From: Ander Conselvan de Oliveira Date: Thu, 24 Mar 2011 20:40:41 +0200 Subject: om: Fix memory leak on read_EncodingInfo error path. Signed-off-by: Ander Conselvan de Oliveira Reviewed-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/omGeneric.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nx-X11/lib') diff --git a/nx-X11/lib/X11/omGeneric.c b/nx-X11/lib/X11/omGeneric.c index dbddc8415..1b017cb21 100644 --- a/nx-X11/lib/X11/omGeneric.c +++ b/nx-X11/lib/X11/omGeneric.c @@ -1910,8 +1910,10 @@ read_EncodingInfo( } else len = strlen(buf); font_data->name = (char *) Xmalloc(len + 1); - if (font_data->name == NULL) + if (font_data->name == NULL) { + Xfree(font_data); return NULL; + } strncpy(font_data->name, buf,len); font_data->name[len] = 0; if (bufptr && _XlcCompareISOLatin1(bufptr, "GL") == 0) -- cgit v1.2.3