Commit 78b0ca2f authored by Erkki Seppälä's avatar Erkki Seppälä Committed by Ulrich Sibiller

ximcp/imRmAttr: Handle leaking colormap_ret

XFree colormap_ret and initialize it when appropriate. Variable "colormap_ret" goes out of scope Reviewed-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: 's avatarErkki Seppälä <erkki.seppala@vincit.fi> Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent b00312f5
...@@ -960,6 +960,7 @@ _XimEncodePreeditValue( ...@@ -960,6 +960,7 @@ _XimEncodePreeditValue(
&count, (Atom)p->value))) &count, (Atom)p->value)))
return False; return False;
XFree(colormap_ret);
} else if (res->xrm_name == XrmStringToQuark(XNFontSet)) { } else if (res->xrm_name == XrmStringToQuark(XNFontSet)) {
int list_ret; int list_ret;
XFontStruct **struct_list; XFontStruct **struct_list;
...@@ -1003,7 +1004,7 @@ _XimEncodeStatusValue( ...@@ -1003,7 +1004,7 @@ _XimEncodeStatusValue(
XIMArg *p) XIMArg *p)
{ {
if (res->xrm_name == XrmStringToQuark(XNStdColormap)) { if (res->xrm_name == XrmStringToQuark(XNStdColormap)) {
XStandardColormap *colormap_ret; XStandardColormap *colormap_ret = NULL;
int count; int count;
if (!(XGetRGBColormaps(ic->core.im->core.display, if (!(XGetRGBColormaps(ic->core.im->core.display,
...@@ -1011,6 +1012,7 @@ _XimEncodeStatusValue( ...@@ -1011,6 +1012,7 @@ _XimEncodeStatusValue(
&count, (Atom)p->value))) &count, (Atom)p->value)))
return False; return False;
XFree(colormap_ret);
} else if (res->xrm_name == XrmStringToQuark(XNFontSet)) { } else if (res->xrm_name == XrmStringToQuark(XNFontSet)) {
int list_ret; int list_ret;
XFontStruct **struct_list; XFontStruct **struct_list;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment