diff options
author | Erkki Seppälä <erkki.seppala@vincit.fi> | 2011-01-31 14:01:58 +0200 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-02-01 23:45:40 -0800 |
commit | 3183269e0979c9dbce9d55d9e03937897dc9fb3b (patch) | |
tree | 80c5d538f9eafd4f500110fb2e48b8c9958049b0 | |
parent | f66a032a937030f2d9baa81744d36dc585bb085c (diff) |
ximcp/imRmAttr: Handle leaking colormap_ret
XFree colormap_ret and initialize it when appropriate.
Variable "colormap_ret" goes out of scope
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | modules/im/ximcp/imRmAttr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/im/ximcp/imRmAttr.c b/modules/im/ximcp/imRmAttr.c index b6d1e129..61b732f0 100644 --- a/modules/im/ximcp/imRmAttr.c +++ b/modules/im/ximcp/imRmAttr.c @@ -956,6 +956,7 @@ _XimEncodePreeditValue( &count, (Atom)p->value))) return False; + XFree(colormap_ret); } else if (res->xrm_name == XrmStringToQuark(XNFontSet)) { int list_ret; XFontStruct **struct_list; @@ -999,7 +1000,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, @@ -1007,6 +1008,7 @@ _XimEncodeStatusValue( &count, (Atom)p->value))) return False; + XFree(colormap_ret); } else if (res->xrm_name == XrmStringToQuark(XNFontSet)) { int list_ret; XFontStruct **struct_list; |