From 78b0ca2fe42ca998708490854d5f5f38ca90d0a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkki=20Sepp=C3=A4l=C3=A4?= Date: Mon, 31 Jan 2011 14:01:58 +0200 Subject: ximcp/imRmAttr: Handle leaking colormap_ret MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit XFree colormap_ret and initialize it when appropriate. Variable "colormap_ret" goes out of scope Reviewed-by: Alan Coopersmith Signed-off-by: Erkki Seppälä Signed-off-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/imRmAttr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nx-X11') diff --git a/nx-X11/lib/X11/imRmAttr.c b/nx-X11/lib/X11/imRmAttr.c index b5abcdd75..ef3ac2ca7 100644 --- a/nx-X11/lib/X11/imRmAttr.c +++ b/nx-X11/lib/X11/imRmAttr.c @@ -960,6 +960,7 @@ _XimEncodePreeditValue( &count, (Atom)p->value))) return False; + XFree(colormap_ret); } else if (res->xrm_name == XrmStringToQuark(XNFontSet)) { int list_ret; XFontStruct **struct_list; @@ -1003,7 +1004,7 @@ _XimEncodeStatusValue( XIMArg *p) { if (res->xrm_name == XrmStringToQuark(XNStdColormap)) { - XStandardColormap *colormap_ret; + XStandardColormap *colormap_ret = NULL; int count; if (!(XGetRGBColormaps(ic->core.im->core.display, @@ -1011,6 +1012,7 @@ _XimEncodeStatusValue( &count, (Atom)p->value))) return False; + XFree(colormap_ret); } else if (res->xrm_name == XrmStringToQuark(XNFontSet)) { int list_ret; XFontStruct **struct_list; -- cgit v1.2.3