xkbcomp: Don't leak atom text and string exprs, again

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
master
Daniel Stone 2010-06-15 15:23:23 +01:00
parent 8904c6eea7
commit a22386d402
2 changed files with 7 additions and 5 deletions

View File

@ -360,6 +360,8 @@ HandleIndicatorMapDef(IndicatorMapDef * def,
ok = SetIndicatorMapField(&led, xkb, field.str, arrayNdx,
var->value) && ok;
}
free(elem.str);
free(field.str);
}
if (ok)
{
@ -480,7 +482,7 @@ BindIndicators(XkbcDescPtr xkb, Bool force, LEDInfo *unbound,
ERROR("No unnamed indicators found\n");
ACTION
("Virtual indicator map \"%s\" not bound\n",
XkbcAtomGetString(led->name));
XkbcAtomText(led->name));
continue;
}
}
@ -515,8 +517,8 @@ BindIndicators(XkbcDescPtr xkb, Bool force, LEDInfo *unbound,
ERROR("Multiple names bound to indicator %d\n",
(unsigned int) led->indicator);
ACTION("Using %s, ignoring %s\n",
XkbcAtomGetString(old),
XkbcAtomGetString(led->name));
XkbcAtomText(old),
XkbcAtomText(led->name));
led->indicator = _LED_NotBound;
if (force)
{

View File

@ -730,6 +730,7 @@ HandleIndicatorNameDef(IndicatorNameDef * def,
return ReportBadType("indicator", "name", buf, "string");
}
ii.name = XkbcInternAtom(tmp.str, False);
free(tmp.str);
ii.virtual = def->virtual;
if (!AddIndicatorName(info, &ii))
return False;
@ -872,8 +873,7 @@ CompileKeycodes(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
for (ii = info.leds; ii != NULL;
ii = (IndicatorNameInfo *) ii->defs.next)
{
xkb->names->indicators[ii->ndx - 1] =
XkbcInternAtom(XkbcAtomGetString(ii->name), False);
xkb->names->indicators[ii->ndx - 1] = ii->name;
if (xkb->indicators != NULL)
{
register unsigned bit;