included.name = stmt->stmt;
stmt->stmt = NULL;
}
+ FreeXKBFile(rtrn);
}
else
{
(*hndlr) (rtrn, xkb, MergeOverride, &next_incl);
MergeIncludedCompatMaps(&included, &next_incl, op);
ClearCompatInfo(&next_incl, xkb);
+ FreeXKBFile(rtrn);
}
else
{
#include "action.h"
#include "keycodes.h"
#include "alias.h"
+#include "parseutils.h"
#define DFLT_FONT "helvetica"
#define DFLT_SLANT "r"
included.name = stmt->stmt;
stmt->stmt = NULL;
}
+ FreeXKBFile(rtrn);
}
else
{
(*hndlr) (rtrn, xkb, MergeOverride, &next_incl);
MergeIncludedGeometry(&included, &next_incl, op);
ClearGeometryInfo(&next_incl);
+ FreeXKBFile(rtrn);
}
else
{
#include "keycodes.h"
#include "misc.h"
#include "alias.h"
+#include "parseutils.h"
const char *
longText(unsigned long val)
included.name = stmt->stmt;
stmt->stmt = NULL;
}
+ FreeXKBFile(rtrn);
}
else
{
HandleKeycodesFile(rtrn, xkb, MergeOverride, &next_incl);
MergeIncludedKeycodes(&included, &next_incl, op);
ClearKeyNamesInfo(&next_incl);
+ FreeXKBFile(rtrn);
}
else
{
/* Check for duplicate entries in the input file */
while ((file) && (ok))
{
- file->topName = mainName;
+ if (file->topName != mainName) {
+ free(file->topName);
+ file->topName = strdup(mainName);
+ }
if ((have & (1 << file->type)) != 0)
{
ERROR("More than one %s section in a %s file\n",
#include "vmod.h"
#include "action.h"
#include "misc.h"
+#include "parseutils.h"
typedef struct _PreserveInfo
{
included.name = stmt->stmt;
stmt->stmt = NULL;
}
+ FreeXKBFile(rtrn);
}
else
{
(*hndlr) (rtrn, xkb, op, &next_incl);
MergeIncludedKeyTypes(&included, &next_incl, op, xkb);
FreeKeyTypesInfo(&next_incl);
+ FreeXKBFile(rtrn);
}
else
{
XkbFile ** file_rtrn, unsigned *merge_rtrn)
{
FILE *file;
- XkbFile *rtrn, *mapToUse;
+ XkbFile *rtrn, *mapToUse, *next;
char oldFile[1024] = {0};
int oldLine = lineNum;
mapToUse = rtrn;
if (stmt->map != NULL)
{
- while ((mapToUse) && ((!uStringEqual(mapToUse->name, stmt->map)) ||
- (mapToUse->type != file_type)))
+ while (mapToUse)
{
- mapToUse = (XkbFile *) mapToUse->common.next;
+ next = (XkbFile *)mapToUse->common.next;
+ mapToUse->common.next = NULL;
+ if (uStringEqual(mapToUse->name, stmt->map) &&
+ mapToUse->type == file_type)
+ {
+ FreeXKBFile(next);
+ break;
+ }
+ else
+ {
+ FreeXKBFile(mapToUse);
+ }
+ mapToUse = next;
}
if (!mapToUse)
{
return 0;
}
+static void
+FreeInclude(IncludeStmt *incl);
+
IncludeStmt *
IncludeCreate(char *str, unsigned merge)
{
else
free(stmt);
return first;
- BAIL:
+
+BAIL:
ERROR("Illegal include statement \"%s\"\n", stmt);
ACTION("Ignored\n");
- while (first)
- {
- incl = first->next;
- free(first->file);
- free(first->map);
- free(first->modifier);
- free(first->path);
- first->file = first->map = first->path = NULL;
- free(first);
- first = incl;
- }
+ FreeInclude(first);
free(stmt);
return NULL;
}
{
case StmtInclude:
FreeInclude((IncludeStmt *)stmt);
+ /* stmt is already free'd here. */
stmt = NULL;
break;
case StmtExpr:
}
free(file->name);
- /* free(file->topName); */
+ free(file->topName);
free(file);
file = next;
}
included.name = stmt->stmt;
stmt->stmt = NULL;
}
+ FreeXKBFile(rtrn);
}
else
{
(*hndlr) (rtrn, xkb, MergeOverride, &next_incl);
MergeIncludedSymbols(&included, &next_incl, op, xkb);
FreeSymbolsInfo(&next_incl);
+ FreeXKBFile(rtrn);
}
else
{
goto unwind_xkb;
}
+ FreeXKBFile(file);
return xkb;
unwind_xkb:
XkbcFreeKeyboard(xkb);
unwind_file:
- /* XXX: here's where we would free the XkbFile */
+ FreeXKBFile(file);
fail:
return NULL;
}
goto unwind_xkb;
}
+ FreeXKBFile(file);
return xkb;
unwind_xkb:
XkbcFreeKeyboard(xkb);
unwind_file:
- /* XXX: here's where we would free the XkbFile */
+ FreeXKBFile(file);
return NULL;
}