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>
master
Peter Hutterer 2021-03-18 11:22:38 +10:00 committed by Ran Benita
parent 694b8f7127
commit 01aa222257
1 changed files with 4 additions and 0 deletions

View File

@ -742,6 +742,10 @@ parse_config_item(struct rxkb_context *ctx,
if (!*name || !strlen(*name)) { if (!*name || !strlen(*name)) {
log_err(ctx, "xml:%d: missing required element 'name'\n", log_err(ctx, "xml:%d: missing required element 'name'\n",
ci->line); ci->line);
free(*name);
free(*description);
free(*brief);
free(*vendor);
return false; return false;
} }