From: Ran Benita Date: Thu, 1 Mar 2012 17:25:37 +0000 (+0200) Subject: Don't leak ActionInfo's X-Git-Tag: accepted/2.0alpha-wayland/20121109.204519~274^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c800c60acea5e96e57ab890c34230cd4db4ea2d2;p=profile%2Fivi%2Flibxkbcommon.git Don't leak ActionInfo's Signed-off-by: Ran Benita --- diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c index cdb0785..b089443 100644 --- a/src/xkbcomp/compat.c +++ b/src/xkbcomp/compat.c @@ -135,6 +135,7 @@ static void ClearCompatInfo(CompatInfo * info, struct xkb_desc * xkb) { int i; + ActionInfo *next; free(info->name); info->name = NULL; @@ -153,7 +154,11 @@ ClearCompatInfo(CompatInfo * info, struct xkb_desc * xkb) memset(&info->groupCompat[0], 0, XkbNumKbdGroups * sizeof(GroupCompatInfo)); info->leds = (LEDInfo *) ClearCommonInfo(&info->leds->defs); - /* 3/30/94 (ef) -- XXX! Should free action info here */ + while (info->act) { + next = info->act->next; + free(info->act); + info->act = next; + } ClearVModInfo(&info->vmods, xkb); } @@ -426,6 +431,8 @@ HandleIncludeCompatMap(IncludeStmt * stmt, included.name = stmt->stmt; stmt->stmt = NULL; } + if (info->act != NULL) + included.act = NULL; FreeXKBFile(rtrn); } else @@ -459,6 +466,8 @@ HandleIncludeCompatMap(IncludeStmt * stmt, next_incl.act = info->act; (*hndlr) (rtrn, xkb, MergeOverride, &next_incl); MergeIncludedCompatMaps(&included, &next_incl, op); + if (info->act != NULL) + next_incl.act = NULL; ClearCompatInfo(&next_incl, xkb); FreeXKBFile(rtrn); }