xkbcomp: Don't leak atom text and string exprs, again Signed-off-by: Daniel Stone <daniel@fooishbar.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
diff --git a/src/xkbcomp/indicators.c b/src/xkbcomp/indicators.c
index 69036c7..726d37b 100644
--- a/src/xkbcomp/indicators.c
+++ b/src/xkbcomp/indicators.c
@@ -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)
{
diff --git a/src/xkbcomp/keycodes.c b/src/xkbcomp/keycodes.c
index 7a77737..847cfb8 100644
--- a/src/xkbcomp/keycodes.c
+++ b/src/xkbcomp/keycodes.c
@@ -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;