Commit c50c87bca278a16523e9406e604613ae7fc2dcf1

Ran Benita 2012-03-01T21:26:25

Don't leak the various *Info's names when overriding them Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index 6dcabbc..cdb0785 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -702,6 +702,7 @@ HandleCompatMapFile(XkbFile * file,
 
     if (merge == MergeDefault)
         merge = MergeAugment;
+    free(info->name);
     info->name = _XkbDupString(file->name);
     stmt = file->defs;
     while (stmt)
diff --git a/src/xkbcomp/geometry.c b/src/xkbcomp/geometry.c
index b90b595..8c31b6f 100644
--- a/src/xkbcomp/geometry.c
+++ b/src/xkbcomp/geometry.c
@@ -2840,6 +2840,7 @@ HandleGeometryFile(XkbFile * file,
 
     if (merge == MergeDefault)
         merge = MergeAugment;
+    free(info->name);
     info->name = _XkbDupString(file->name);
     stmt = file->defs;
     while (stmt)
diff --git a/src/xkbcomp/keycodes.c b/src/xkbcomp/keycodes.c
index fe97d62..69f87d1 100644
--- a/src/xkbcomp/keycodes.c
+++ b/src/xkbcomp/keycodes.c
@@ -798,6 +798,7 @@ HandleKeycodesFile(XkbFile * file,
 {
     ParseCommon *stmt;
 
+    free(info->name);
     info->name = _XkbDupString(file->name);
     stmt = file->defs;
     while (stmt)
diff --git a/src/xkbcomp/keytypes.c b/src/xkbcomp/keytypes.c
index fd49271..b0a1b11 100644
--- a/src/xkbcomp/keytypes.c
+++ b/src/xkbcomp/keytypes.c
@@ -1028,6 +1028,7 @@ HandleKeyTypesFile(XkbFile * file,
 {
     ParseCommon *stmt;
 
+    free(info->name);
     info->name = _XkbDupString(file->name);
     stmt = file->defs;
     while (stmt)
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index 416447e..95936ab 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -1579,6 +1579,7 @@ HandleSymbolsFile(XkbFile * file,
 {
     ParseCommon *stmt;
 
+    free(info->name);
     info->name = _XkbDupString(file->name);
     stmt = file->defs;
     while (stmt)