registry: plug a potential memleak for invalid rules files If the name is missing in a configItem, we'd fail and leak the memory for description, brief and vendor. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
diff --git a/src/registry.c b/src/registry.c
index dcaaa1b..7198828 100644
--- a/src/registry.c
+++ b/src/registry.c
@@ -742,6 +742,10 @@ parse_config_item(struct rxkb_context *ctx,
if (!*name || !strlen(*name)) {
log_err(ctx, "xml:%d: missing required element 'name'\n",
ci->line);
+ free(*name);
+ free(*description);
+ free(*brief);
+ free(*vendor);
return false;
}