From: Daniel Stone Date: Tue, 15 Jun 2010 14:23:23 +0000 (+0100) Subject: xkbcomp: Don't leak atom text and string exprs, again X-Git-Tag: accepted/2.0alpha-wayland/20121109.204519~396 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a22386d402d9e40ca1a04406068458412d52b221;p=profile%2Fivi%2Flibxkbcommon.git xkbcomp: Don't leak atom text and string exprs, again Signed-off-by: Daniel Stone --- 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;